diff options
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/http.c b/lib/http.c index 8e7fb0fa9..21574e21d 100644 --- a/lib/http.c +++ b/lib/http.c @@ -419,8 +419,6 @@ static CURLcode http_perhapsrewind(struct connectdata *conn) case HTTPREQ_POST: if(data->state.infilesize != -1) expectsend = data->state.infilesize; - else if(data->set.postfields) - expectsend = (curl_off_t)strlen(data->set.postfields); break; case HTTPREQ_PUT: if(data->state.infilesize != -1) @@ -2559,12 +2557,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) if(conn->bits.authneg) postsize = 0; - else { - /* figure out the size of the postfields */ - postsize = (data->state.infilesize != -1)? - data->state.infilesize: - (data->set.postfields? (curl_off_t)strlen(data->set.postfields):-1); - } + else + /* the size of the post body */ + postsize = data->state.infilesize; /* We only set Content-Length and allow a custom Content-Length if we don't upload data chunked, as RFC2616 forbids us to set both |