From 0caae3c4be47c7859eb1f26ffa7a0cf4b5a82160 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 29 Feb 2020 12:00:18 +0100 Subject: http: mark POSTs with no body as "upload done" from the start 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/http.c b/lib/http.c index 39e4d3447..bff3adc17 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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 -- cgit v1.2.1