Remy Maucherat wrote:
Bill Barker wrote:

AFAICT, this code is assuming that there will always be a message body in the POST Request. However, this is not necessarily the case (and is certainly not true for the problem at hand). Eventually, SocketInputStream.read() is called from within o.a.coyote.http11.InternalReadBuffer.fill(). This call will throw a SocketTimeoutException.



Then the test is broken. It should either have a 'Content-Length: 0' header or a 'Transfer-Encoding: chunked' header with a '0' content delimater.

Nope, that's incorrect.
From RFC2616, the official HTTP standard definition:

   The presence of a message-body in a request is signaled by the
   inclusion of a Content-Length or Transfer-Encoding header field in
   the request's message-headers.

A bodyless POST request w/o a TE or CL header field is permitted by RFC2616. Of course, if the POST really does have a body, then bad things are guaranteed to happen.


Or it could close the input of the socket (note: nobody should be crazy enough to use this method, though, as I suppose it won't work in many cases).

Nope, that technique won't work. The server can close the connection to signal the client that it's done sending a response body, but the client cannot use the same technique to signal the server that it has completed sending a request body.

Hope this helps.

Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to