httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [users@httpd] CGI based WebDAV client and Transfer-Encoding: Chunked issue
Date Mon, 08 Dec 2008 21:35:11 GMT
Paul wrote:
> Hello,
> 
> I am working on patching a program that was written by a different
> developer who is no longer with company.  The program is a CGI program
> that acts as a WebDAV server.  Recently we found a problem when a mac
> user running Mac OS 10.5 (Leopard) tries to paste a file into the
> WebDAV folder on their computer.  Instead of putting the file on the
> server, it was creating a 0 kb file.  After searching I managed to
> find out this was caused by Apple's switch to using
> "Transfer-Encoding: Chunked" rather than defining a Content-Length.
> 
> The problem I am having is that I do not know how to find out the
> length of the input file that is coming from the client.  According to
> the Transfer-Encoding specification, the data is supposed to be in the
> form of:
> "23
> This is the data in the first chunk
> 1A
> and this is the second one
> 0"
> 
> but when I do something like:
> " cin.read((char *) myBuffer, 30);"
> (note, 30 is just an example here), the result in the buffer starts
> with the text being sent, and does not include any chunk sizes.  Am I
> reading in the data wrong? Is the Mac sending the wrong information?
> Is Apache filtering out the chunk data?

Yes.  Your CGI should be blistfully unaware of the change to chunked
encoding, simply read to the EOF (end of file) status of cin.

The same is true of your CGI responses; httpd will chunk them when the
client is capable, and again your program has nothing to do with this;
it's part of the HTTP/1.1 protocol.

Bill

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message