IPP Mail Archive: Re: IPP> Chunked POST: SUMMARY

Re: IPP> Chunked POST: SUMMARY

kugler@us.ibm.com
Wed, 6 Jan 1999 15:11:26 -0700

Here is a summary of the responses that I received to my queries about
chunked POST in HTTP/1.1.

1. All HTTP/1.1 applications that receive entities MUST accept the
=93chunked=94 transfer-coding, thus allowing this mechanism to be used =
for
messages when the message length cannot be determined in advance.
2. However, an origin server MAY refuse to accept a request without a
defined Content-Length by responding with status code 411 (Length
Required).
3. The Content-Length header field MUST NOT be sent if a Transfer-Enco=
ding
header field is present.
4. An origin server acting as a CGI 1.1 gateway for a request MUST
determine and set the CONTENT_LENGTH metavariable.
5. Origin servers MUST remove the Transfer-Encoding before passing a
request body to a plug-in, servlet, (Fast)CGI, or across any other gate=
way
boundary.

Origin servers supporting CGI 1.1 have two options when receiving a POS=
T
request with "Transfer-Encoding: chunked" for a CGI 1.1 resource:
1. Reject the request with 411 (Length Required).
2. Filter and buffer the request to determine CONTENT_LENGTH before
passing the decoded request body to the CGI application. If the buffer=
ed
request grows too large, the server MAY reject the request with status =
code
413 (Request Entity Too Large) and the server MAY close the connection =
to
prevent the client from continuing the request.

Origin servers supporting the Servlet API 2.1 have three options when
receiving a POST request with "Transfer-Encoding: chunked" for a servle=
t
resource:
1. Reject the request with 411 (Length Required).
2. Filter and buffer the request to determine CONTENT_LENGTH before
passing the decoded request body to the servlet. If the buffered reque=
st
grows too large, the server MAY reject the request with status code 413=

(Request Entity Too Large) and the server MAY close the connection to
prevent the client from continuing the request.
3. Pass a filtered input stream to the servlet and filter the request =
body
on-the-fly to remove the chunked transfer-coding. Indicate the end of =
the
request body with EOF (end of file) on the servlet input stream.

Implications for IPP:
1. The IPP layer doesn't have to deal with chunking. In the context o=
f
CGI scripts, the HTTP layer either rejects a chunked POST request with =
411
or removes any chunking information in the received data and supplies
CONTENT_LENGTH.

2. The HTTP/1.1 standard does not guarantee that an origin server will=

accept chunked requests, regardless of the resource identified in the
request.

- Carl Kugler
=