cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: chunked uploads aren't working

From: <RBramante_at_on.com>
Date: Tue, 27 Jan 2004 11:03:27 -0500

This seems to be working ok for me (always term the chunk with CRLF, even
if it is the 0 chunk)

$ diff -u transfer.c transfer.new
--- transfer.c 2004-01-21 16:50:06.000000000 -0500
+++ transfer.new 2004-01-27 10:54:54.078125000 -0500
@@ -152,13 +152,13 @@

     /* copy the prefix to the buffer */
     memcpy(conn->upload_fromhere, hexbuffer, hexlen);
- if(nread>hexlen) {
- /* append CRLF to the data */
- memcpy(conn->upload_fromhere +
- nread, "\r\n", 2);
- nread+=2;
- }
- else {
+
+ /* append CRLF to the data */
+ memcpy(conn->upload_fromhere +
+ nread, "\r\n", 2);
+ nread+=2;
+
+ if((nread - hexlen - 2) == 0) {
       /* mark this as done once this chunk is transfered */
       conn->keep.upload_done = TRUE;
     }

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-27