summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-10-25 17:10:21 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-10-25 23:32:45 +0200
commitbc8674d87d6c5dd6f87aa61214b0b295cad746d0 (patch)
tree2068b16443fcdab142bafbbebbff20ccb746289e
parentf9910e85fa1e4e93c3dbd19a628d0b47cc1034d0 (diff)
downloadcurl-bc8674d87d6c5dd6f87aa61214b0b295cad746d0.tar.gz
c-hyper: make CURLOPT_SUPPRESS_CONNECT_HEADERS work
Verified by the enabled test 1288 Closes #7905
-rw-r--r--lib/c-hyper.c36
-rw-r--r--lib/http_proxy.c3
-rw-r--r--tests/data/DISABLED1
3 files changed, 23 insertions, 17 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index c691544b7..c253cd36e 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -156,13 +156,15 @@ static int hyper_each_header(void *userdata,
Curl_debug(data, CURLINFO_HEADER_IN, headp, len);
- writetype = CLIENTWRITE_HEADER;
- if(data->set.include_header)
- writetype |= CLIENTWRITE_BODY;
- result = Curl_client_write(data, writetype, headp, len);
- if(result) {
- data->state.hresult = CURLE_ABORTED_BY_CALLBACK;
- return HYPER_ITER_BREAK;
+ if(!data->state.hconnect || !data->set.suppress_connect_headers) {
+ writetype = CLIENTWRITE_HEADER;
+ if(data->set.include_header)
+ writetype |= CLIENTWRITE_BODY;
+ result = Curl_client_write(data, writetype, headp, len);
+ if(result) {
+ data->state.hresult = CURLE_ABORTED_BY_CALLBACK;
+ return HYPER_ITER_BREAK;
+ }
}
data->info.header_size += (long)len;
@@ -284,16 +286,18 @@ static CURLcode status_line(struct Curl_easy *data,
len = Curl_dyn_len(&data->state.headerb);
Curl_debug(data, CURLINFO_HEADER_IN, Curl_dyn_ptr(&data->state.headerb),
len);
- writetype = CLIENTWRITE_HEADER;
- if(data->set.include_header)
- writetype |= CLIENTWRITE_BODY;
- result = Curl_client_write(data, writetype,
- Curl_dyn_ptr(&data->state.headerb), len);
- if(result) {
- data->state.hresult = CURLE_ABORTED_BY_CALLBACK;
- return HYPER_ITER_BREAK;
- }
+ if(!data->state.hconnect || !data->set.suppress_connect_headers) {
+ writetype = CLIENTWRITE_HEADER;
+ if(data->set.include_header)
+ writetype |= CLIENTWRITE_BODY;
+ result = Curl_client_write(data, writetype,
+ Curl_dyn_ptr(&data->state.headerb), len);
+ if(result) {
+ data->state.hresult = CURLE_ABORTED_BY_CALLBACK;
+ return HYPER_ITER_BREAK;
+ }
+ }
data->info.header_size += (long)len;
data->req.headerbytecount += (long)len;
data->req.httpcode = http_status;
diff --git a/lib/http_proxy.c b/lib/http_proxy.c
index 5244a25bb..fc050a07d 100644
--- a/lib/http_proxy.c
+++ b/lib/http_proxy.c
@@ -213,6 +213,9 @@ static void connect_done(struct Curl_easy *data)
data->info.httpcode = 0; /* clear it as it might've been used for the
proxy */
data->req.ignorebody = FALSE;
+#ifdef USE_HYPER
+ data->state.hconnect = FALSE;
+#endif
infof(data, "CONNECT phase completed!");
}
}
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
index 6856112d4..591b01d3d 100644
--- a/tests/data/DISABLED
+++ b/tests/data/DISABLED
@@ -64,7 +64,6 @@
1021
1156
1160
-1288
1294
1417
1430