diff options
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c index 35cae48e8..460ce0a86 100644 --- a/lib/http.c +++ b/lib/http.c @@ -485,6 +485,7 @@ CURLcode Curl_http(struct connectdata *conn) struct Cookie *co=NULL; /* no cookies from start */ char *ppath = conn->ppath; /* three previous function arguments */ char *host = conn->name; + const char *te = ""; /* tranfer-encoding */ if(!conn->proto.http) { /* Only allocate this struct if we don't already have it! */ @@ -546,6 +547,14 @@ CURLcode Curl_http(struct connectdata *conn) conn->allocptr.cookie = aprintf("Cookie: %s\015\012", data->set.cookie); } + if(conn->upload_chunky) { + if(!checkheaders(data, "Transfer-Encoding:")) { + te = "Transfer-Encoding: chunked\r\n"; + } + /* else + our header was already added, what to do now? */ + } + if(data->cookies) { co = Curl_cookie_getlist(data->cookies, host, ppath, @@ -717,7 +726,8 @@ CURLcode Curl_http(struct connectdata *conn) "%s" /* pragma */ "%s" /* accept */ "%s" /* accept-encoding */ - "%s", /* referer */ + "%s" /* referer */ + "%s",/* transfer-encoding */ data->set.customrequest?data->set.customrequest: (data->set.no_body?"HEAD": @@ -739,7 +749,8 @@ CURLcode Curl_http(struct connectdata *conn) http->p_accept?http->p_accept:"", (data->set.encoding && *data->set.encoding && conn->allocptr.accept_encoding)? conn->allocptr.accept_encoding:"", /* 08/28/02 jhrg */ - (data->change.referer && conn->allocptr.ref)?conn->allocptr.ref:"" /* Referer: <data> <CRLF> */ + (data->change.referer && conn->allocptr.ref)?conn->allocptr.ref:"" /* Referer: <data> <CRLF> */, + te ); if(co) { |