summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/http.c')
-rw-r--r--Utilities/cmcurl/lib/http.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/Utilities/cmcurl/lib/http.c b/Utilities/cmcurl/lib/http.c
index 219dcc2..e611d27 100644
--- a/Utilities/cmcurl/lib/http.c
+++ b/Utilities/cmcurl/lib/http.c
@@ -1308,7 +1308,7 @@ CURLcode Curl_buffer_send(struct dynbuf *in,
|| IS_HTTPS_PROXY(conn->http_proxy.proxytype)
#endif
)
- && conn->httpversion != 20) {
+ && conn->httpversion < 20) {
/* Make sure this doesn't send more body bytes than what the max send
speed says. The request bytes do not count to the max speed.
*/
@@ -2667,11 +2667,7 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn,
#ifndef USE_HYPER
/* With Hyper the body is always passed on separately */
if(data->set.postfields) {
-
- /* In HTTP2, we send request body in DATA frame regardless of
- its size. */
- if(conn->httpversion < 20 &&
- !data->state.expect100header &&
+ if(!data->state.expect100header &&
(http->postsize < MAX_INITIAL_POST_SIZE)) {
/* if we don't use expect: 100 AND
postsize is less than MAX_INITIAL_POST_SIZE
@@ -2832,16 +2828,18 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
}
if(co) {
struct Cookie *store = co;
+ size_t clen = 8; /* hold the size of the generated Cookie: header */
/* now loop through all cookies that matched */
while(co) {
if(co->value) {
- if(0 == count) {
+ size_t add;
+ if(!count) {
result = Curl_dyn_addn(r, STRCONST("Cookie: "));
if(result)
break;
}
- if((Curl_dyn_len(r) + strlen(co->name) + strlen(co->value) + 1) >=
- MAX_COOKIE_HEADER_LEN) {
+ add = strlen(co->name) + strlen(co->value) + 1;
+ if(clen + add >= MAX_COOKIE_HEADER_LEN) {
infof(data, "Restricted outgoing cookies due to header size, "
"'%s' not sent", co->name);
linecap = TRUE;
@@ -2851,6 +2849,7 @@ CURLcode Curl_http_cookies(struct Curl_easy *data,
co->name, co->value);
if(result)
break;
+ clen += add + (count ? 2 : 0);
count++;
}
co = co->next; /* next cookie please */
@@ -3381,6 +3380,9 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
}
}
+ if(data->req.upload_done)
+ Curl_conn_ev_data_done_send(data);
+
if((conn->httpversion >= 20) && data->req.upload_chunky)
/* upload_chunky was set above to set up the request in a chunky fashion,
but is disabled here again to avoid that the chunked encoded version is
@@ -4569,8 +4571,8 @@ CURLcode Curl_http_req_make(struct httpreq **preq,
if(!req->path)
goto out;
}
- Curl_dynhds_init(&req->headers, 0, DYN_H2_HEADERS);
- Curl_dynhds_init(&req->trailers, 0, DYN_H2_TRAILERS);
+ Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
+ Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
result = CURLE_OK;
out:
@@ -4727,8 +4729,8 @@ CURLcode Curl_http_req_make2(struct httpreq **preq,
if(result)
goto out;
- Curl_dynhds_init(&req->headers, 0, DYN_H2_HEADERS);
- Curl_dynhds_init(&req->trailers, 0, DYN_H2_TRAILERS);
+ Curl_dynhds_init(&req->headers, 0, DYN_HTTP_REQUEST);
+ Curl_dynhds_init(&req->trailers, 0, DYN_HTTP_REQUEST);
result = CURLE_OK;
out:
@@ -4858,8 +4860,8 @@ CURLcode Curl_http_resp_make(struct http_resp **presp,
if(!resp->description)
goto out;
}
- Curl_dynhds_init(&resp->headers, 0, DYN_H2_HEADERS);
- Curl_dynhds_init(&resp->trailers, 0, DYN_H2_TRAILERS);
+ Curl_dynhds_init(&resp->headers, 0, DYN_HTTP_REQUEST);
+ Curl_dynhds_init(&resp->trailers, 0, DYN_HTTP_REQUEST);
result = CURLE_OK;
out: