1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 03:55:03 -05:00

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
This commit is contained in:
Daniel Stenberg 2020-02-29 12:00:18 +01:00
parent 5494afac8f
commit 0caae3c4be
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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