aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-05 15:50:16 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-05 15:50:16 +0000
commitcc90a235f4792febd308640c6463c8bdc3aec863 (patch)
tree12b72c4db32cfc8f674b763a396df07a31c69077
parente97ce57d0b2b183bd3be9429bab40054ab972a8c (diff)
if an empty 'transfer-encoding:' header is provided, we switch off the
chunky coding of uploads
-rw-r--r--lib/http.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/http.c b/lib/http.c
index 3bab60df3..665906196 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1123,17 +1123,16 @@ CURLcode Curl_http(struct connectdata *conn)
conn->allocptr.cookie = NULL;
if(!conn->bits.upload_chunky && (data->set.httpreq != HTTPREQ_GET)) {
- /* not a chunky transfer but data is to be sent */
+ /* not a chunky transfer yet, but data is to be sent */
ptr = checkheaders(data, "Transfer-Encoding:");
if(ptr) {
/* Some kind of TE is requested, check if 'chunked' is chosen */
- if(Curl_compareheader(ptr, "Transfer-Encoding:", "chunked"))
- /* we have been told explicitly to upload chunky so deal with it! */
- conn->bits.upload_chunky = TRUE;
+ conn->bits.upload_chunky =
+ Curl_compareheader(ptr, "Transfer-Encoding:", "chunked");
+ te = "";
}
}
-
- if(conn->bits.upload_chunky) {
+ else if(conn->bits.upload_chunky) {
/* RFC2616 section 4.4:
Messages MUST NOT include both a Content-Length header field and a
non-identity transfer-coding. If the message does include a non-
@@ -1143,8 +1142,9 @@ CURLcode Curl_http(struct connectdata *conn)
te = "Transfer-Encoding: chunked\r\n";
}
else {
- /* The "Transfer-Encoding:" header was already added. */
te = "";
+ conn->bits.upload_chunky = FALSE; /* transfer-encoding was disabled,
+ so don't chunkify this! */
}
}