diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-06-08 23:30:57 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-06-10 08:42:27 +0200 |
commit | c214a6a17b2b6f6e4720c40cec9a061b8504daf0 (patch) | |
tree | 3871e7f35065d7e2870829e6ce3678c1fba3ba57 /lib/c-hyper.c | |
parent | aeb064db032f7663e9d98b78b85e4bbfbae8b045 (diff) | |
download | curl-c214a6a17b2b6f6e4720c40cec9a061b8504daf0.tar.gz |
c-hyper: abort CONNECT response reading early on non 2xx responses
Fixes test 493
Closes #7209
Diffstat (limited to 'lib/c-hyper.c')
-rw-r--r-- | lib/c-hyper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c index c7102979e..e3fd26c1a 100644 --- a/lib/c-hyper.c +++ b/lib/c-hyper.c @@ -186,7 +186,13 @@ static int hyper_body_chunk(void *userdata, const hyper_buf *chunk) Curl_safefree(data->req.newurl); } #endif - result = Curl_http_firstwrite(data, data->conn, &done); + if(data->state.hconnect && + (data->req.httpcode/100 != 2)) { + done = TRUE; + result = CURLE_OK; + } + else + result = Curl_http_firstwrite(data, data->conn, &done); if(result || done) { infof(data, "Return early from hyper_body_chunk\n"); data->state.hresult = result; |