aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBalazs Kovacsics <balazs.kovacsics@ericsson.com>2019-07-22 14:37:37 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-07-29 13:18:53 +0200
commit802aa5ae27ce755b94477976397502dc056227c4 (patch)
treea9c9b24c4dbe2ae89d9ce609ce1a2602c47a336d /lib
parent9736ac03ab3c9b352437dc1cb6cb4568bbf1a711 (diff)
HTTP: use chunked Transfer-Encoding for HTTP_POST if size unknown
If using the read callback for HTTP_POST, and POSTFIELDSIZE is not set, automatically add a Transfer-Encoding: chunked header, same as it is already done for HTTP_PUT, HTTP_POST_FORM and HTTP_POST_MIME. Update test 1514 according to the new behaviour. Closes #4138
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index 36e94f762..065a26817 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2247,8 +2247,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
else {
if((conn->handler->protocol & PROTO_FAMILY_HTTP) &&
(((httpreq == HTTPREQ_POST_MIME || httpreq == HTTPREQ_POST_FORM) &&
- http->postsize < 0) ||
- (data->set.upload && data->state.infilesize == -1))) {
+ http->postsize < 0) ||
+ ((data->set.upload || httpreq == HTTPREQ_POST) &&
+ data->state.infilesize == -1))) {
if(conn->bits.authneg)
/* don't enable chunked during auth neg */
;