- As found out and reported by Dan Petitt, libcurl didn't show progress/call

the progress callback for the first (potentially huge) piece of body data
  sent together with the POST request headers in the initial send().
This commit is contained in:
Daniel Stenberg 2008-03-27 13:07:12 +00:00
parent 7c6a026230
commit b425e851fb
4 changed files with 426 additions and 417 deletions

@ -6,6 +6,11 @@
Changelog Changelog
Daniel Stenberg (27 Mar 2008)
- As found out and reported by Dan Petitt, libcurl didn't show progress/call
the progress callback for the first (potentially huge) piece of body data
sent together with the POST request headers in the initial send().
Daniel Stenberg (25 Mar 2008) Daniel Stenberg (25 Mar 2008)
- Made setting the CURLOPT_SSL_CTX_FUNCTION option return a failure in case - Made setting the CURLOPT_SSL_CTX_FUNCTION option return a failure in case
libcurl wasn't built to use OpenSSL as that is a prerequisite for this libcurl wasn't built to use OpenSSL as that is a prerequisite for this

@ -73,6 +73,6 @@ advice from friends like these:
Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol, Dan Fandrich, Mike Hommey, Pooyan McSporran, Jerome Muffat-Meridol,
Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad, Kaspar Brand, Gautam Kachroo, Zmey Petroff, Georg Lippitsch, Sam Listopad,
Anatoli Tubman, Mike Protts, Michael Calmer, Brian Ulm, Dmitry Popov, Anatoli Tubman, Mike Protts, Michael Calmer, Brian Ulm, Dmitry Popov,
Jes Badwal Jes Badwal, Dan Petitt
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

@ -3,8 +3,6 @@ To be addressed before 7.18.1 (planned release: April 2008)
[feature freeze entered, no new features!] [feature freeze entered, no new features!]
127 - Dan Petitt's Progress During Large Posts problem
128 - Phil Blundell's ares and ipv6 fix 128 - Phil Blundell's ares and ipv6 fix
129 - Pierre Reiss' libcurl + https + multi = lost information 129 - Pierre Reiss' libcurl + https + multi = lost information

@ -1929,6 +1929,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
Curl_HttpReq httpreq = data->set.httpreq; Curl_HttpReq httpreq = data->set.httpreq;
char *addcookies = NULL; char *addcookies = NULL;
curl_off_t included_body = 0; curl_off_t included_body = 0;
const char *httpstring;
send_buffer *req_buffer;
curl_off_t postsize; /* off_t type to be able to hold a large file size */
/* Always consider the DO phase done after this function call, even if there /* Always consider the DO phase done after this function call, even if there
may be parts of the request that is not yet sent, since we can deal with may be parts of the request that is not yet sent, since we can deal with
@ -2299,13 +2303,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
} }
} }
{
/* Use 1.1 unless the use specificly asked for 1.0 */ /* Use 1.1 unless the use specificly asked for 1.0 */
const char *httpstring= httpstring= data->set.httpversion==CURL_HTTP_VERSION_1_0?"1.0":"1.1";
data->set.httpversion==CURL_HTTP_VERSION_1_0?"1.0":"1.1";
send_buffer *req_buffer;
curl_off_t postsize; /* off_t type to be able to hold a large file size */
/* initialize a dynamic send-buffer */ /* initialize a dynamic send-buffer */
req_buffer = add_buffer_init(); req_buffer = add_buffer_init();
@ -2773,8 +2772,15 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
} }
if(result) if(result)
return 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 #endif