]> granicus.if.org Git - curl/commitdiff
http: set state.infilesize when sending formposts
authorDaniel Stenberg <daniel@haxx.se>
Wed, 27 Feb 2019 21:30:32 +0000 (22:30 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 28 Feb 2019 14:24:03 +0000 (15:24 +0100)
Without it set, we would unwillingly triger the "HTTP error before end
of send, stop sending" condition even if the entire POST body had been
sent (since it wouldn't know the expected size) which would
unnecessarily log that message and close the connection when it didn't
have to.

Reported-by: Matt McClure
Bug: https://curl.haxx.se/mail/archive-2019-02/0023.html
Closes #3624

lib/http.c

index eb81aae712f4643d0da42b7ceb2b3d3f0efb4bdc..9f44b8a68d63c4ce40eb3246d194ba28708f278b 100644 (file)
@@ -2733,7 +2733,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
       break;
     }
 
-    postsize = http->postsize;
+    data->state.infilesize = postsize = http->postsize;
 
     /* 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