diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-06-07 23:52:34 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-06-14 23:31:01 +0200 |
commit | ff7097f72c26a9d389f135f76cb28e10ca30f4c1 (patch) | |
tree | 25d9e6ec57b9ee38c7a31120430f7c8d7034ce28 /lib/http.c | |
parent | 55fc47a40130fd6ec78fcb83da3ecedb702fa0f7 (diff) |
urldata: store POST size in state.infilesize too
... to simplify checking when PUT _or_ POST have completed.
Reported-by: Frank Meier
Bug: http://curl.haxx.se/mail/lib-2015-06/0019.html
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/http.c b/lib/http.c index 8e422f0bf..7a5137e86 100644 --- a/lib/http.c +++ b/lib/http.c @@ -424,8 +424,8 @@ static CURLcode http_perhapsrewind(struct connectdata *conn) /* figure out how much data we are expected to send */ switch(data->set.httpreq) { case HTTPREQ_POST: - if(data->set.postfieldsize != -1) - expectsend = data->set.postfieldsize; + if(data->state.infilesize != -1) + expectsend = data->state.infilesize; else if(data->set.postfields) expectsend = (curl_off_t)strlen(data->set.postfields); break; @@ -2572,8 +2572,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) postsize = 0; else { /* figure out the size of the postfields */ - postsize = (data->set.postfieldsize != -1)? - data->set.postfieldsize: + postsize = (data->state.infilesize != -1)? + data->state.infilesize: (data->set.postfields? (curl_off_t)strlen(data->set.postfields):-1); } @@ -2696,7 +2696,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) return result; } - else if(data->set.postfieldsize) { + else if(data->state.infilesize) { /* set the upload size to the progress meter */ Curl_pgrsSetUploadSize(data, postsize?postsize:-1); |