cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Progress During Large Posts

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 16 Mar 2008 00:02:39 +0100 (CET)

On Sat, 15 Mar 2008, Daniel Stenberg wrote:

> I'm suspecting that you get the entire or at least most of the request-body
> sent in the lib/http.c:add_buffer_send() function and that doesn't seem to
> call any progress callback which looks like a bug to me. Do you think this
> could be what happens?

If so, this is my suggested fix:

diff -u -b -B -r1.365 http.c
--- http.c 1 Mar 2008 22:32:03 -0000 1.365
+++ http.c 15 Mar 2008 22:59:35 -0000
@@ -2773,8 +2772,15 @@
      }
      if(result)
        return result;
+
+ if(http->writebytecount) {
+ /* if a request-body has been sent off, we make sure this progress is noted
+ properly */
+ Curl_pgrsSetUploadCounter(data, http->writebytecount);
+ if(Curl_pgrsUpdate(conn))
+ result = CURLE_ABORTED_BY_CALLBACK;
    }

- return CURLE_OK;
+ return result;
  }
  #endif

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-16