curl: update to 7.82.0

update 7.80.0 (2021-11-10) to 7.82.0 (2022-03-05)

include the upstream PR 8664 fixing http2: fix handling of
client-initiated "done"

changelog:
- https://curl.se/changes.html#7_82_0
- https://curl.se/changes.html#7_81_0
This commit is contained in:
heitbaum 2022-01-06 00:35:23 +00:00 committed by Rudi Heitbaum
parent ae5c4718af
commit 5667636803
2 changed files with 120 additions and 2 deletions

View File

@ -3,8 +3,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="curl"
PKG_VERSION="7.80.0"
PKG_SHA256="a132bd93188b938771135ac7c1f3ac1d3ce507c1fcbef8c471397639214ae2ab"
PKG_VERSION="7.82.0"
PKG_SHA256="0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"
PKG_LICENSE="MIT"
PKG_SITE="https://curl.haxx.se"
PKG_URL="https://curl.haxx.se/download/${PKG_NAME}-${PKG_VERSION}.tar.xz"

View File

@ -0,0 +1,118 @@
From 6175c91100caffd8912964e4f7f2a31e15e5164a Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 31 Mar 2022 23:28:35 +0200
Subject: [PATCH 1/3] http2: handle DONE called for the paused stream
As it could otherwise stall all streams on the connection
Reported-by: Evangelos Foutras
Fixes #8626
---
lib/http2.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 82a9939301b5..34daaf17c594 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1240,11 +1240,10 @@ void Curl_http2_done(struct Curl_easy *data, bool premature)
if(!nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE,
http->stream_id, NGHTTP2_STREAM_CLOSED))
(void)nghttp2_session_send(httpc->h2);
-
- if(http->stream_id == httpc->pause_stream_id) {
- H2BUGF(infof(data, "stopped the pause stream!"));
- httpc->pause_stream_id = 0;
- }
+ }
+ if(http->stream_id == httpc->pause_stream_id) {
+ H2BUGF(infof(data, "DONE the pause stream!"));
+ httpc->pause_stream_id = 0;
}
if(data->state.drain)
From b1e7ce9006c8d25ba231e50a97deffb41af58102 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 31 Mar 2022 23:37:36 +0200
Subject: [PATCH 2/3] http: close the stream (not connection) on time condition
abort
---
lib/http.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/http.c b/lib/http.c
index 6445f98f8d0d..63cc748e8b97 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2955,7 +2955,7 @@ CURLcode Curl_http_firstwrite(struct Curl_easy *data,
infof(data, "Simulate a HTTP 304 response!");
/* we abort the transfer before it is completed == we ruin the
re-use ability. Close the connection */
- connclose(conn, "Simulated 304 handling");
+ streamclose(conn, "Simulated 304 handling");
return CURLE_OK;
}
} /* we have a time condition */
From 39f3a0a79f63e51066865cf996bd7667cbd82341 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Fri, 1 Apr 2022 07:48:43 +0200
Subject: [PATCH 3/3] http2: RST the stream if we stop it on our own will
For the "simulated 304" case the done-call isn't considered "premature"
but since the server didn't close the stream it needs to be reset to
stop delivering data.
---
lib/http2.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 34daaf17c594..34031f17c160 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -825,10 +825,14 @@ static int on_data_chunk_recv(nghttp2_session *session, uint8_t flags,
/* get the stream from the hash based on Stream ID */
data_s = nghttp2_session_get_stream_user_data(session, stream_id);
- if(!data_s)
- /* Receiving a Stream ID not in the hash should not happen, this is an
- internal error more than anything else! */
- return NGHTTP2_ERR_CALLBACK_FAILURE;
+ if(!data_s) {
+ /* Receiving a Stream ID not in the hash should not happen - unless
+ we have aborted a transfer artificially and there were more data
+ in the pipeline. Silently ignore. */
+ H2BUGF(fprintf(stderr, "Data for stream %u but it doesn't exist\n",
+ stream_id));
+ return 0;
+ }
stream = data_s->req.p.http;
if(!stream)
@@ -1234,17 +1238,19 @@ void Curl_http2_done(struct Curl_easy *data, bool premature)
!httpc->h2) /* not HTTP/2 ? */
return;
- if(premature) {
+ /* do this before the reset handling, as that might clear ->stream_id */
+ if(http->stream_id == httpc->pause_stream_id) {
+ H2BUGF(infof(data, "DONE the pause stream (%x)", http->stream_id));
+ httpc->pause_stream_id = 0;
+ }
+ if(premature || (!http->closed && http->stream_id)) {
/* RST_STREAM */
set_transfer(httpc, data); /* set the transfer */
+ H2BUGF(infof(data, "RST stream %x", http->stream_id));
if(!nghttp2_submit_rst_stream(httpc->h2, NGHTTP2_FLAG_NONE,
http->stream_id, NGHTTP2_STREAM_CLOSED))
(void)nghttp2_session_send(httpc->h2);
}
- if(http->stream_id == httpc->pause_stream_id) {
- H2BUGF(infof(data, "DONE the pause stream!"));
- httpc->pause_stream_id = 0;
- }
if(data->state.drain)
drained_transfer(data, httpc);