Using PUT without a content-length
Joe Orton
joe at manyfish.co.uk
Fri Jul 25 12:25:19 EDT 2008
Hi Julien!
On Fri, Jul 25, 2008 at 11:34:09AM +0200, Julien Reichel wrote:
> Hi,
>
> So looking more deeply at the code and at the HTTP specification, it
> looks like closing the connection is not a good idea :-)
Correct :)
> So here is a patch for supporting variable length request body using the
> Transfer-Encoding : chunk mode
>
> I was not so sure for the correct handling of the status.
>
> Let me know if you think this patch is appropriate.
Thanks for the patch! Yes the general approach here is fine; there are
a few things which need work though:
1) ne_request.h needs updating for the new interface of passing length
== -1 to ne_set_request_body_provider().
2) sending chunks should really be done using writev(), so a new method
would need to be exposed via ne_socket.* for that.
3) in the status handling, sr.total should be set to -1 to indicate
"unknown length", otherwise correct
4) code style nits, no // comments, follow neon style generally with
e.g. "if (foo)" not "if ( foo )" etc ;)
Would you be willing to work on an updated patch for this addressing
some of these issues?
Regards, Joe
More information about the neon
mailing list