diff --git a/packages/web/curl/package.mk b/packages/web/curl/package.mk index 117b520fc7..d485b72333 100644 --- a/packages/web/curl/package.mk +++ b/packages/web/curl/package.mk @@ -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" diff --git a/packages/web/curl/patches/curl-0001-pr-8664.patch b/packages/web/curl/patches/curl-0001-pr-8664.patch new file mode 100644 index 0000000000..50e1afb073 --- /dev/null +++ b/packages/web/curl/patches/curl-0001-pr-8664.patch @@ -0,0 +1,118 @@ +From 6175c91100caffd8912964e4f7f2a31e15e5164a Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +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 +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 +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);