一旦WEB服务器打开了一个到SERVLET容器的连接,连接处于下面的状态:◆ 空闲这个连接上没有处理的请求。
◆ 已分派连接正在处理特定的请求。
一旦一个连接被分配给一个特定的请求,在连接上发送的基本请求信息是高度压缩的。在这点,SERVLET容器大概准备开始处理请求,当它处理的时候,它能发回下面的信息给WEB服务器:
◆ SEND_HEADERS
发送一组头到浏览器。
◆ SEND_BODY_CHUNK
发送一块主体数据到浏览器。
◆ GET_BODY_CHUNK
从请求获得下一个数据如果还没有全部传输完,如果请求内容的包长度非常大或者长度不确定,这是非常必要的。例如上载文件。注意这和HTTP的块传输没有关联。
结束请求处理循环。
============================================================================================================================================‘
============================================================================================================================================‘
============================================================================================================================================‘
============================================================================================================================================‘
============================================================================================================================================‘
============================================================================================================================================‘
包方向
|
0
|
1
|
2
|
3
|
4…(n+3)
|
Server->Container
|
0x12
|
0x34
|
数据长度(n)
|
数据(payload)
| |
Container->Server
|
A
|
B
|
数据长度(n)
|
数据(payload)
|
方向
|
code
|
包类型
|
描述
|
Server->Container
|
2
| ||
7
|
Shutdown
| ||
8
|
Ping
| ||
10
|
Cping
| ||
none
|
Data
| ||
Container->Server
|
3
|
Send Body Chunk
| |
4
|
Send Headers
| ||
5
|
End Response
|
Marks the end of the response
| |
6
|
Get Body Chunk
| ||
9
|
CPong Reply
|
The reply to a CPing request
|
AJP13_FORWARD_REQUEST :=
prefix_code (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
method (byte)
protocol (string)
req_uri (string)
remote_addr (string)
remote_host (string)
server_name (string)
server_port (integer)
is_ssl (boolean)
num_headers (integer)
attributes *(attribut_name attribute_value)
|
req_header_name :=
|
req_header_value := (string)
|
attribute_value := (string)
|
code
|
POST
|
4
| |
OPTIONS
|
1
|
PUT
|
5
|
GET
|
2
|
DELETE
|
6
|
HEAD
|
3
|
TRACE
|
7
|
请求头
| ||
SC_REQ_ACCEPT
| ||
accept-charset
|
0xA002
|
SC_REQ_ACCEPT_CHARSET
|
accept-encoding
|
0xA003
|
SC_REQ_ACCEPT_ENCODING
|
accept-language
|
0xA004
|
SC_REQ_ACCEPT_LANGUAGE
|
authorization
|
0xA005
|
SC_REQ_AUTHORIZATION
|
connection
|
0xA006
|
SC_REQ_CONNECTION
|
content-type
|
0xA007
|
SC_REQ_CONTENT_TYPE
|
content-length
|
0xA008
|
SC_REQ_CONTENT_LENGTH
|
cookie
|
0xA009
|
SC_REQ_COOKIE
|
cookie2
|
0xA00A
|
SC_REQ_COOKIE2
|
host
|
0xA00B
| |
pragma
|
0xA00C
|
SC_REQ_PRAGMA
|
referer
|
0xA00D
|
SC_REQ_REFERER
|
user-agent
|
0xA00E
|
SC_REQ_USER_AGENT
|
AJP13_SEND_HEADERS :=
prefix_code 4
http_status_code (integer)
http_status_msg (string)
num_headers (integer)
res_header_name :=
sc_res_header_name | (string) [see below for how this is parsed]
header_value := (string)
AJP13_SEND_BODY_CHUNK :=
prefix_code 3
chunk_length (integer)
AJP13_END_RESPONSE :=
prefix_code 5
reuse (boolean)
AJP13_GET_BODY_CHUNK :=
prefix_code 6
requested_length (integer)
|
请求头
| ||
Content-Type
|
0xA001
|
SC_RESP_CONTENT_TYPE
|
Content-Language
|
0xA002
|
SC_RESP_CONTENT_LANGUAGE
|
Content-Length
|
0xA003
|
SC_RESP_CONTENT_LENGTH
|
Date
|
0xA004
|
SC_RESP_DATE
|
Last-Modified
|
0xA005
|
SC_RESP_LAST_MODIFIED
|
Location
|
0xA006
|
SC_RESP_LOCATION
|
Set-Cookie
|
0xA007
|
SC_RESP_SET_COOKIE
|
Set-Cookie2
|
0xA008
|
SC_RESP_SET_COOKIE2
|
Servlet-Engine
|
0xA009
|
SC_RESP_SERVLET_ENGINE
|
Status
|
0xA00A
|
SC_RESP_STATUS
|
WWW-Authenticate
|
0xA00B
|
SC_RESP_WWW_AUTHENTICATE
|
响应头数据包:
响应正文数据包: