]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_proxy_ajp.xml
* Remove trailing whitespace from a bunch of *.xml files
[apache] / docs / manual / mod / mod_proxy_ajp.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_proxy_ajp.xml.meta">
24
25 <name>mod_proxy_ajp</name>
26 <description>AJP support module for
27 <module>mod_proxy</module></description>
28 <status>Extension</status>
29 <sourcefile>mod_proxy_ajp.c</sourcefile>
30 <identifier>proxy_ajp_module</identifier>
31
32 <summary>
33     <p>This module <em>requires</em> the service of <module
34     >mod_proxy</module>. It provides support for the
35     <code>Apache JServ Protocol version 1.3</code> (hereafter
36     <em>AJP13</em>).</p>
37
38     <p>Thus, in order to get the ability of handling <code>AJP13</code>
39     protocol, <module>mod_proxy</module> and
40     <module>mod_proxy_ajp</module> have to be present in the server.</p>
41
42     <note type="warning"><title>Warning</title>
43       <p>Do not enable proxying until you have <a
44       href="mod_proxy.html#access">secured your server</a>. Open proxy
45       servers are dangerous both to your network and to the Internet at
46       large.</p>
47     </note>
48 </summary>
49
50 <seealso><module>mod_proxy</module></seealso>
51 <seealso><a href="../env.html">Environment Variable documentation</a></seealso>
52
53 <section id="usage"><title>Usage</title>
54     <p>This module is used to reverse proxy to a backend application server
55     (e.g. Apache Tomcat) using the AJP13 protocol. The usage is similar to
56     an HTTP reverse proxy, but uses the <code>ajp://</code> prefix:</p>
57
58     <example><title>Simple Reverse Proxy</title>
59     <highlight language="config">
60     ProxyPass "/app" "ajp://backend.example.com:8009/app"
61     </highlight>
62     </example>
63
64     <p>Balancers may also be used:</p>
65     <example><title>Balancer Reverse Proxy</title>
66     <highlight language="config">
67 &lt;Proxy balancer://cluster&gt;
68     BalancerMember ajp://app1.example.com:8009 loadfactor=1
69     BalancerMember ajp://app2.example.com:8009 loadfactor=2
70     ProxySet lbmethod=bytraffic
71 &lt;/Proxy&gt;
72 ProxyPass "/app" "balancer://cluster/app"
73       </highlight>
74     </example>
75
76     <p>Note that usually no
77     <directive module="mod_proxy">ProxyPassReverse</directive>
78     directive is necessary. The AJP request includes the original host
79     header given to the proxy, and the application server can be expected
80     to generate self-referential headers relative to this host, so no
81     rewriting is necessary.</p>
82
83     <p>The main exception is when the URL path on the proxy differs from that
84     on the
85     backend. In this case, a redirect header can be rewritten relative to the
86     original host URL (not the backend <code>ajp://</code> URL), for
87     example:</p>
88     <example><title>Rewriting Proxied Path</title>
89     <highlight language="config">
90 ProxyPass "/apps/foo" "ajp://backend.example.com:8009/foo"
91 ProxyPassReverse "/apps/foo" "http://www.example.com/foo"
92     </highlight>
93     </example>
94     <p>However, it is usually better to deploy the application on the backend
95     server at the same path as the proxy rather than to take this approach.
96     </p>
97 </section>
98
99 <section id="env"><title>Environment Variables</title>
100     <p>Environment variables whose names have the prefix <code>AJP_</code>
101     are forwarded to the origin server as AJP request attributes
102     (with the AJP_ prefix removed from the name of the key).</p>
103 </section>
104
105 <section id="overviewprotocol"><title>Overview of the protocol</title>
106     <p>The <code>AJP13</code> protocol is packet-oriented.  A binary format
107     was presumably chosen over the more readable plain text for reasons of
108     performance.  The web server communicates with the servlet container over
109     TCP connections.  To cut down on the expensive process of socket creation,
110     the web server will attempt to maintain persistent TCP connections to the
111     servlet container, and to reuse a connection for multiple request/response
112     cycles.</p>
113     <p>Once a connection is assigned to a particular request, it will not be
114     used for any others until the request-handling cycle has terminated.  In
115     other words, requests are not multiplexed over connections.  This makes
116     for much simpler code at either end of the connection, although it does
117     cause more connections to be open at once.</p>
118     <p>Once the web server has opened a connection to the servlet container,
119     the connection can be in one of the following states:</p>
120     <ul>
121     <li> Idle <br/> No request is being handled over this connection. </li>
122     <li> Assigned <br/> The connection is handling a specific request.</li>
123     </ul>
124     <p>Once a connection is assigned to handle a particular request, the basic
125     request information (e.g. HTTP headers, etc) is sent over the connection in
126     a highly condensed form (e.g. common strings are encoded as integers).
127     Details of that format are below in Request Packet Structure. If there is a
128     body to the request <code>(content-length > 0)</code>, that is sent in a
129     separate packet immediately after.</p>
130     <p>At this point, the servlet container is presumably ready to start
131     processing the request.  As it does so, it can send the
132     following messages back to the web server:</p>
133     <ul>
134     <li>SEND_HEADERS <br/>Send a set of headers back to the browser.</li>
135     <li>SEND_BODY_CHUNK <br/>Send a chunk of body data back to the browser.
136     </li>
137     <li>GET_BODY_CHUNK <br/>Get further data from the request if it hasn't all
138     been transferred yet.  This is necessary because the packets have a fixed
139     maximum size and arbitrary amounts of data can be included the body of a
140     request (for uploaded files, for example).  (Note: this is unrelated to
141     HTTP chunked transfer).</li>
142     <li>END_RESPONSE <br/> Finish the request-handling cycle.</li>
143     </ul>
144     <p>Each message is accompanied by a differently formatted packet of data.
145     See Response Packet Structures below for details.</p>
146 </section>
147
148 <section id="basppacketstruct"><title>Basic Packet Structure</title>
149     <p>There is a bit of an XDR heritage to this protocol, but it differs
150     in lots of ways (no 4 byte alignment, for example).</p>
151     <p>AJP13 uses network byte order for all data types.</p>
152     <p>There are four data types in the protocol: bytes, booleans,
153     integers and strings.</p>
154     <dl>
155     <dt><strong>Byte</strong></dt><dd>A single byte.</dd>
156     <dt><strong>Boolean</strong></dt>
157       <dd>A single byte, <code>1 = true</code>, <code>0 = false</code>.
158       Using other non-zero values as true (i.e. C-style) may work in some places,
159       but it won't in others.</dd>
160     <dt><strong>Integer</strong></dt>
161       <dd>A number in the range of <code>0 to 2^16 (32768)</code>.  Stored in
162       2 bytes with the high-order byte first.</dd>
163     <dt><strong>String</strong></dt>
164       <dd>A variable-sized string (length bounded by 2^16). Encoded with
165       the length packed into two bytes first, followed by the string
166       (including the terminating '\0').  Note that the encoded length does
167       <strong>not</strong> include the trailing '\0' -- it is like
168       <code>strlen</code>.  This is a touch confusing on the Java side, which
169       is littered with odd autoincrement statements to skip over these
170       terminators.  I believe the reason this was done was to allow the C
171       code to be extra efficient when reading strings which the servlet
172       container is sending back -- with the terminating \0 character, the
173       C code can pass around references into a single buffer, without copying.
174       if the \0 was missing, the C code would have to copy things out in order
175       to get its notion of a string.</dd>
176     </dl>
177
178   <section><title>Packet Size</title>
179     <p>According to much of the code, the max packet size is <code>
180     8 * 1024 bytes (8K)</code>.  The actual length of the packet is encoded in
181     the header.</p>
182   </section>
183   <section><title>Packet Headers</title>
184     <p>Packets sent from the server to the container begin with
185     <code>0x1234</code>.  Packets sent from the container to the server
186     begin with <code>AB</code> (that's the ASCII code for A followed by the
187     ASCII code for B).  After those first two bytes, there is an integer
188     (encoded as above) with the length of the payload.  Although this might
189     suggest that the maximum payload could be as large as 2^16, in fact, the
190     code sets the maximum to be 8K.</p>
191     <table>
192        <columnspec><column width=".2"/><column width=".1"/><column width=".1"/><column width=".2"/><column width=".2"/><column width=".2"/></columnspec>
193       <tr>
194         <th colspan="6"><em>Packet Format (Server->Container)</em></th>
195       </tr>
196       <tr>
197         <th>Byte</th>
198         <td>0</td>
199         <td>1</td>
200         <td>2</td>
201         <td>3</td>
202         <td>4...(n+3)</td>
203       </tr>
204       <tr>
205         <th>Contents</th>
206         <td>0x12</td>
207         <td>0x34</td>
208         <td colspan="2">Data Length (n)</td>
209         <td>Data</td>
210       </tr>
211     </table>
212     <table>
213        <columnspec><column width=".2"/><column width=".1"/><column width=".1"/><column width=".2"/><column width=".2"/><column width=".2"/></columnspec>
214       <tr>
215         <th colspan="6"><em>Packet Format (Container->Server)</em></th>
216       </tr>
217       <tr>
218         <th>Byte</th>
219         <td>0</td>
220         <td>1</td>
221         <td>2</td>
222         <td>3</td>
223         <td>4...(n+3)</td>
224       </tr>
225       <tr>
226         <th>Contents</th>
227         <td>A</td>
228         <td>B</td>
229         <td colspan="2">Data Length (n)</td>
230         <td>Data</td>
231       </tr>
232     </table>
233     <p>For most packets, the first byte of the payload encodes the type of
234      message.  The exception is for request body packets sent from the server to
235      the container -- they are sent with a standard packet header (<code>
236      0x1234</code> and then length of the packet), but without any prefix code
237      after that.</p>
238      <p>The web server can send the following messages to the servlet
239      container:</p>
240     <table>
241        <columnspec><column width=".2"/><column width=".3"/><column width=".5"/></columnspec>
242       <tr>
243         <td>Code</td>
244         <td>Type of Packet</td>
245         <td>Meaning</td>
246       </tr>
247       <tr>
248         <td>2</td>
249         <td>Forward Request</td>
250         <td>Begin the request-processing cycle with the following data</td>
251       </tr>
252       <tr>
253         <td>7</td>
254         <td>Shutdown</td>
255         <td>The web server asks the container to shut itself down.</td>
256       </tr>
257       <tr>
258         <td>8</td>
259         <td>Ping</td>
260         <td>The web server asks the container to take control
261         (secure login phase).</td>
262       </tr>
263       <tr>
264         <td>10</td>
265         <td>CPing</td>
266         <td>The web server asks the container to respond quickly with a CPong.
267         </td>
268       </tr>
269       <tr>
270         <td>none</td>
271         <td>Data</td>
272         <td>Size (2 bytes) and corresponding body data.</td>
273       </tr>
274     </table>
275     <p>To ensure some basic security, the container will only actually do the
276     <code>Shutdown</code> if the request comes from the same machine on which
277     it's hosted.</p>
278     <p>The first <code>Data</code> packet is send immediately after the
279     <code>Forward Request</code> by the web server.</p>
280     <p>The servlet container can send the following types of messages to the
281     webserver:</p>
282     <table>
283        <columnspec><column width=".2"/><column width=".3"/><column width=".5"/></columnspec>
284       <tr>
285         <td>Code</td>
286         <td>Type of Packet</td>
287         <td>Meaning</td>
288       </tr>
289       <tr>
290         <td>3</td>
291         <td>Send Body Chunk</td>
292         <td>Send a chunk of the body from the servlet container to the web
293         server (and presumably, onto the browser). </td>
294       </tr>
295       <tr>
296         <td>4</td>
297         <td>Send Headers</td>
298         <td>Send the response headers from the servlet container to the web
299         server (and presumably, onto the browser).</td>
300       </tr>
301       <tr>
302         <td>5</td>
303         <td>End Response</td>
304         <td>Marks the end of the response (and thus the request-handling cycle).
305         </td>
306       </tr>
307       <tr>
308         <td>6</td>
309         <td>Get Body Chunk</td>
310         <td>Get further data from the request if it hasn't all been
311         transferred yet.</td>
312       </tr>
313       <tr>
314         <td>9</td>
315         <td>CPong Reply</td>
316         <td>The reply to a CPing request</td>
317       </tr>
318     </table>
319     <p>Each of the above messages has a different internal structure, detailed
320     below.</p>
321   </section>
322 </section>
323 <section id="rpacetstruct"><title>Request Packet Structure</title>
324     <p>For messages from the server to the container of type
325     <em>Forward Request</em>:</p>
326     <example><pre>
327 AJP13_FORWARD_REQUEST :=
328     prefix_code      (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
329     method           (byte)
330     protocol         (string)
331     req_uri          (string)
332     remote_addr      (string)
333     remote_host      (string)
334     server_name      (string)
335     server_port      (integer)
336     is_ssl           (boolean)
337     num_headers      (integer)
338     request_headers *(req_header_name req_header_value)
339     attributes      *(attribut_name attribute_value)
340     request_terminator (byte) OxFF
341     </pre></example>
342     <p>The <code>request_headers</code> have the following structure:
343     </p><example><pre>
344 req_header_name :=
345     sc_req_header_name | (string)  [see below for how this is parsed]
346
347 sc_req_header_name := 0xA0xx (integer)
348
349 req_header_value := (string)
350 </pre></example>
351     <p>The <code>attributes</code> are optional and have the following
352     structure:</p>
353     <example><pre>
354 attribute_name := sc_a_name | (sc_a_req_attribute string)
355
356 attribute_value := (string)
357
358     </pre></example>
359     <p>Not that the all-important header is <code>content-length</code>,
360     because it determines whether or not the container looks for another
361     packet immediately.</p>
362   <section><title>Detailed description of the elements of Forward Request
363   </title></section>
364   <section><title>Request prefix</title>
365     <p>For all requests, this will be 2. See above for details on other Prefix
366     codes.</p>
367   </section>
368   <section><title>Method</title>
369     <p>The HTTP method, encoded as a single byte:</p>
370     <table>
371       <tr><td>Command Name</td><td>Code</td></tr>
372       <tr><td>OPTIONS</td><td>1</td></tr>
373       <tr><td>GET</td><td>2</td></tr>
374       <tr><td>HEAD</td><td>3</td></tr>
375       <tr><td>POST</td><td>4</td></tr>
376       <tr><td>PUT</td><td>5</td></tr>
377       <tr><td>DELETE</td><td>6</td></tr>
378       <tr><td>TRACE</td><td>7</td></tr>
379       <tr><td>PROPFIND</td><td>8</td></tr>
380       <tr><td>PROPPATCH</td><td>9</td></tr>
381       <tr><td>MKCOL</td><td>10</td></tr>
382       <tr><td>COPY</td><td>11</td></tr>
383       <tr><td>MOVE</td><td>12</td></tr>
384       <tr><td>LOCK</td><td>13</td></tr>
385       <tr><td>UNLOCK</td><td>14</td></tr>
386       <tr><td>ACL</td><td>15</td></tr>
387       <tr><td>REPORT</td><td>16</td></tr>
388       <tr><td>VERSION-CONTROL</td><td>17</td></tr>
389       <tr><td>CHECKIN</td><td>18</td></tr>
390       <tr><td>CHECKOUT</td><td>19</td></tr>
391       <tr><td>UNCHECKOUT</td><td>20</td></tr>
392       <tr><td>SEARCH</td><td>21</td></tr>
393       <tr><td>MKWORKSPACE</td><td>22</td></tr>
394       <tr><td>UPDATE</td><td>23</td></tr>
395       <tr><td>LABEL</td><td>24</td></tr>
396       <tr><td>MERGE</td><td>25</td></tr>
397       <tr><td>BASELINE_CONTROL</td><td>26</td></tr>
398       <tr><td>MKACTIVITY</td><td>27</td></tr>
399     </table>
400     <p>Later version of ajp13, will transport
401     additional methods, even if they are not in this list.</p>
402   </section>
403   <section><title>protocol, req_uri, remote_addr, remote_host, server_name,
404   server_port, is_ssl</title>
405     <p>These are all fairly self-explanatory.  Each of these is required, and
406     will be sent for every request.</p>
407   </section>
408   <section><title>Headers</title>
409     <p>The structure of <code>request_headers</code> is the following:
410     First, the number of headers <code>num_headers</code> is encoded.
411     Then, a series of header name <code>req_header_name</code> / value
412     <code>req_header_value</code> pairs follows.
413     Common header names are encoded as integers,
414     to save space.  If the header name is not in the list of basic headers,
415     it is encoded normally (as a string, with prefixed length).  The list of
416     common headers <code>sc_req_header_name</code>and their codes
417     is as follows (all are case-sensitive):</p>
418     <table>
419       <tr><td>Name</td><td>Code value</td><td>Code name</td></tr>
420       <tr><td>accept</td><td>0xA001</td><td>SC_REQ_ACCEPT</td></tr>
421       <tr><td>accept-charset</td><td>0xA002</td><td>SC_REQ_ACCEPT_CHARSET
422       </td></tr>
423       <tr><td>accept-encoding</td><td>0xA003</td><td>SC_REQ_ACCEPT_ENCODING
424       </td></tr>
425       <tr><td>accept-language</td><td>0xA004</td><td>SC_REQ_ACCEPT_LANGUAGE
426       </td></tr>
427       <tr><td>authorization</td><td>0xA005</td><td>SC_REQ_AUTHORIZATION</td>
428       </tr>
429       <tr><td>connection</td><td>0xA006</td><td>SC_REQ_CONNECTION</td></tr>
430       <tr><td>content-type</td><td>0xA007</td><td>SC_REQ_CONTENT_TYPE</td>
431       </tr>
432       <tr><td>content-length</td><td>0xA008</td><td>SC_REQ_CONTENT_LENGTH</td>
433       </tr>
434       <tr><td>cookie</td><td>0xA009</td><td>SC_REQ_COOKIE</td></tr>
435       <tr><td>cookie2</td><td>0xA00A</td><td>SC_REQ_COOKIE2</td></tr>
436       <tr><td>host</td><td>0xA00B</td><td>SC_REQ_HOST</td></tr>
437       <tr><td>pragma</td><td>0xA00C</td><td>SC_REQ_PRAGMA</td></tr>
438       <tr><td>referer</td><td>0xA00D</td><td>SC_REQ_REFERER</td></tr>
439       <tr><td>user-agent</td><td>0xA00E</td><td>SC_REQ_USER_AGENT</td></tr>
440     </table>
441     <p>The Java code that reads this grabs the first two-byte integer and if
442     it sees an <code>'0xA0'</code> in the most significant
443     byte, it uses the integer in the second byte as an index into an array of
444     header names.  If the first byte is not <code>0xA0</code>, it assumes that
445     the two-byte integer is the length of a string, which is then read in.</p>
446     <p>This works on the assumption that no header names will have length
447     greater than <code>0x9FFF (==0xA000 - 1)</code>, which is perfectly
448     reasonable, though somewhat arbitrary.</p>
449     <note><title>Note:</title>
450     The <code>content-length</code> header is extremely
451     important.  If it is present and non-zero, the container assumes that
452     the request has a body (a POST request, for example), and immediately
453     reads a separate packet off the input stream to get that body.
454     </note>
455   </section>
456   <section><title>Attributes</title>
457     <p>The attributes prefixed with a <code>?</code>
458     (e.g. <code>?context</code>) are all optional.  For each, there is a
459     single byte code to indicate the type of attribute, and then its value
460     (string or integer).  They can be sent in any order (though the C code
461     always sends them in the order listed below).  A special terminating code
462     is sent to signal the end of the list of optional attributes. The list of
463     byte codes is:</p>
464     <table>
465       <tr><td>Information</td><td>Code Value</td><td>Type Of Value</td><td>Note</td></tr>
466       <tr><td>?context</td><td>0x01</td><td>-</td><td>Not currently implemented
467       </td></tr>
468       <tr><td>?servlet_path</td><td>0x02</td><td>-</td><td>Not currently implemented
469       </td></tr>
470       <tr><td>?remote_user</td><td>0x03</td><td>String</td><td></td></tr>
471       <tr><td>?auth_type</td><td>0x04</td><td>String</td><td></td></tr>
472       <tr><td>?query_string</td><td>0x05</td><td>String</td><td></td></tr>
473       <tr><td>?jvm_route</td><td>0x06</td><td>String</td><td></td></tr>
474       <tr><td>?ssl_cert</td><td>0x07</td><td>String</td><td></td></tr>
475       <tr><td>?ssl_cipher</td><td>0x08</td><td>String</td><td></td></tr>
476       <tr><td>?ssl_session</td><td>0x09</td><td>String</td><td></td></tr>
477       <tr><td>?req_attribute</td><td>0x0A</td><td>String</td><td>Name (the name of the
478       attribute follows)</td></tr>
479       <tr><td>?ssl_key_size</td><td>0x0B</td><td>Integer</td><td></td></tr>
480       <tr><td>are_done</td><td>0xFF</td><td>-</td><td>request_terminator</td></tr>
481     </table>
482     <p>The <code>context</code> and <code>servlet_path</code> are not
483     currently set by the C code, and most of the Java code completely ignores
484     whatever is sent over for those fields (and some of it will actually break
485     if a string is sent along after one of those codes).  I don't know if this
486     is a bug or an unimplemented feature or just vestigial code, but it's
487     missing from both sides of the connection.</p>
488     <p>The <code>remote_user</code> and <code>auth_type</code> presumably
489     refer to HTTP-level authentication, and communicate the remote user's
490     username and the type of authentication used to establish their identity
491     (e.g. Basic, Digest).</p>
492     <p>The <code>query_string</code>, <code>ssl_cert</code>,
493     <code>ssl_cipher</code>, and <code>ssl_session</code> refer to the
494     corresponding pieces of HTTP and HTTPS.</p>
495     <p>The <code>jvm_route</code>, is used to support sticky
496     sessions -- associating a user's sesson with a particular Tomcat instance
497     in the presence of multiple, load-balancing servers.</p>
498     <p>Beyond this list of basic attributes, any number of other attributes
499     can be sent via the <code>req_attribute</code> code <code>0x0A</code>.
500     A pair of strings to represent the attribute name and value are sent
501     immediately after each instance of that code.  Environment values are passed
502     in via this method.</p>
503     <p>Finally, after all the attributes have been sent, the attribute
504     terminator, <code>0xFF</code>, is sent.  This signals both the end of the
505     list of attributes and also then end of the Request Packet.</p>
506   </section>
507 </section>
508
509 <section id="resppacketstruct"><title>Response Packet Structure</title>
510     <p>for messages which the container can send back to the server.</p>
511     <example><pre>
512 AJP13_SEND_BODY_CHUNK :=
513   prefix_code   3
514   chunk_length  (integer)
515   chunk        *(byte)
516   chunk_terminator (byte) Ox00
517
518
519 AJP13_SEND_HEADERS :=
520   prefix_code       4
521   http_status_code  (integer)
522   http_status_msg   (string)
523   num_headers       (integer)
524   response_headers *(res_header_name header_value)
525
526 res_header_name :=
527     sc_res_header_name | (string)   [see below for how this is parsed]
528
529 sc_res_header_name := 0xA0 (byte)
530
531 header_value := (string)
532
533 AJP13_END_RESPONSE :=
534   prefix_code       5
535   reuse             (boolean)
536
537
538 AJP13_GET_BODY_CHUNK :=
539   prefix_code       6
540   requested_length  (integer)
541     </pre></example>
542   <section><title>Details:</title></section>
543   <section><title>Send Body Chunk</title>
544     <p>The chunk is basically binary data, and is sent directly back to the
545     browser.</p>
546   </section>
547   <section><title>Send Headers</title>
548     <p>The status code and message are the usual HTTP things
549     (e.g. <code>200</code> and <code>OK</code>). The response header names are
550     encoded the same way the request header names are. See header_encoding above
551     for details about how the codes are distinguished from the strings.<br />
552     The codes for common headers are:</p>
553     <table>
554       <tr><td>Name</td><td>Code value</td></tr>
555       <tr><td>Content-Type</td><td>0xA001</td></tr>
556       <tr><td>Content-Language</td><td>0xA002</td></tr>
557       <tr><td>Content-Length</td><td>0xA003</td></tr>
558       <tr><td>Date</td><td>0xA004</td></tr>
559       <tr><td>Last-Modified</td><td>0xA005</td></tr>
560       <tr><td>Location</td><td>0xA006</td></tr>
561       <tr><td>Set-Cookie</td><td>0xA007</td></tr>
562       <tr><td>Set-Cookie2</td><td>0xA008</td></tr>
563       <tr><td>Servlet-Engine</td><td>0xA009</td></tr>
564       <tr><td>Status</td><td>0xA00A</td></tr>
565       <tr><td>WWW-Authenticate</td><td>0xA00B</td></tr>
566     </table>
567     <p> After the code or the string header name, the header value is
568     immediately encoded.</p>
569   </section>
570   <section><title>End Response</title>
571     <p>Signals the end of this request-handling cycle.  If the
572     <code>reuse</code> flag is true <code>(anything other than 0 in the actual
573     C code)</code>, this TCP connection can now be used to handle new incoming
574     requests.  If <code>reuse</code> is false (==0), the connection should
575     be closed.</p>
576   </section>
577   <section><title>Get Body Chunk</title>
578     <p>The container asks for more data from the request (If the body was
579     too large to fit in the first packet sent over or when the request is
580     chunked). The server will send a body packet back with an amount of data
581     which is the minimum of the <code>request_length</code>, the maximum send
582     body size <code>(8186 (8 Kbytes - 6))</code>, and the number of bytes
583     actually left to send from the request body.<br/>
584     If there is no more data in the body (i.e. the servlet container is
585     trying to read past the end of the body), the server will send back an
586     <em>empty</em> packet, which is a body packet with a payload length of 0.
587     <code>(0x12,0x34,0x00,0x00)</code></p>
588   </section>
589 </section>
590
591
592 </modulesynopsis>