]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: mark POSTs with no body as "upload done" from the start
authorDaniel Stenberg <daniel@haxx.se>
Sat, 29 Feb 2020 11:00:18 +0000 (12:00 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Mar 2020 14:43:04 +0000 (15:43 +0100)
As we have logic that checks if we get a >= 400 reponse code back before
the upload is done, which then got confused since it wasn't "done" but
yet there was no data to send!

Reported-by: IvanoG on github
Fixes #4996
Closes #5002

lib/http.c

index 39e4d34476e1ebd21786e37743c1f926f0c42eef..bff3adc17010f8d08b492393c8bca561a4d3eff6 100644 (file)
@@ -3044,6 +3044,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
   }
   if(result)
     return result;
+  if(!postsize)
+    data->req.upload_done = TRUE;
 
   if(data->req.writebytecount) {
     /* if a request-body has been sent off, we make sure this progress is noted