- 论坛徽章:
- 5
|
注意下面的HTTP交互内容,它们是在同一个连接上顺序完成的
- 请求头1
- GET /loginbox.php HTTP/1.1
- Accept: */*
- Referer: http://www.chinaunix.net/
- Accept-Language: zh-cn
- User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)
- Host: bbs.chinaunix.net
- Connection: Keep-Alive
- Cookie: XXXXXXXXXXXXXXXXXX
- 回复头1
- HTTP/1.1 200 OK
- Date: Mon, 11 Jun 2007 04:38:57 GMT
- Server: Apache/2.0.54 (Unix) PHP/5.2.0
- X-Powered-By: PHP/5.2.0
- Cache-Control: no-cache, must-revalidate
- Pragma: no-cache
- Content-Length: 1420
- Keep-Alive: timeout=15, max=100
- Connection: Keep-Alive
- Content-Type: text/html; charset=GB2312
- 回复内容1
- ####################
- ####################
- ####################
- ####################
- ####################
- {timeout 是这段时间}
- 请求头2
- GET /viewthread.php?tid=947518 HTTP/1.1
- Accept: */*
- Referer: http://www.chinaunix.net/
- Accept-Language: zh-cn
- User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon)
- Host: bbs.chinaunix.net
- Connection: Keep-Alive
- Cookie:
- 回复头2
- HTTP/1.1 200 OK
- Date: Mon, 11 Jun 2007 04:39:03 GMT
- Server: Apache/2.0.54 (Unix) PHP/5.2.0
- X-Powered-By: PHP/5.2.0
- Set-Cookie: XXXXXXXXXXXXXXXXXX
- Set-Cookie: XXXXXXXXXXXXXXXXXX
- Set-Cookie: XXXXXXXXXXXXXXXXXX
- Set-Cookie: XXXXXXXXXXXXXXXXXX
- Keep-Alive: timeout=15, max=99
- Connection: Keep-Alive
- Transfer-Encoding: chunked
- Content-Type: text/html; charset=GB2312
- 回复内容2
- ####################
- ####################
- ####################
- ####################
- ####################
复制代码
Apache中timeout的值指的是Keep-Alive: timeout=15, max=99,也就是它告诉浏览器在同一个连接上的前后请求之间的最大时间间隔,而不是同一个请求的连接等待或数据等待的时间,尤其是在自己写服务器的时候要防止只连接不交互数据的恶意连接
[ 本帖最后由 xinglp 于 2007-6-11 12:53 编辑 ] |
|