On Mon, Jul 09, 2007 at 05:14:10PM -0700, Dave Hayden wrote:
> I got a call the other day from an engineer at Apple who found a fun  
> bug in iDisk: their WebDAV server reads the PUT Content-length into,  
> yes, a 32-bit signed int, so the only way to send files bigger than  
> 2G is to use Transfer-encoding: chunked. I don't know if y'all have  
> any interest in adding a proper chunked PUT implementation into neon,  
> but here's some code for the curious. The only change to neon was  
> making a req->body_length of -1 signal indeterminate length: I added  
> a conditional if ( length >= 0 ) in set_body_length() to suppress  
> adding the content-length header, and I changed the two instances of  
> req->body_length > 0 in send_request() to req->body_length != 0.

Hi Dave; yes the API is written to allow chunked request bodies like 
this (length == -1 for the provider interface) but the chunk-size header 
stuff really needs to be done in ne_request, not in the provider 
callback itself, otherwise every provider has to implement the same 
code.  If you fancied taking a bash at that, patches would be welcome :)

Also note that you shouldn't use a chunked request body without first 
checking the server response-version with ne_version_pre_http11(sess). 
If there is an HTTP/1.0 proxy between server and client then chunked 
request bodies can't be used.  (and in general, using chunked request 
bodies is not known to be well supported even in HTTP/1.1 proxies)

Regards,

joe
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to