main/curl: revert a broken commit

fixes some http2 checksums.

the commits also seems to break `cargo fetch` for rust...

https://github.com/curl/curl/issues/10525
This commit is contained in:
psykose 2023-02-15 18:04:10 +00:00
parent de9654b100
commit ed89ad7059
2 changed files with 62 additions and 1 deletions

View File

@ -9,7 +9,7 @@
pkgname=curl
pkgver=7.88.0
pkgrel=0
pkgrel=1
pkgdesc="URL retrival utility and library"
url="https://curl.se/"
arch="all"
@ -23,6 +23,7 @@ subpackages="$pkgname-dbg $pkgname-static $pkgname-doc $pkgname-dev libcurl"
[ -z "$BOOTSTRAP" ] && subpackages="$subpackages $pkgname-zsh-completion $pkgname-fish-completion"
source="
https://curl.se/download/curl-$pkgver.tar.xz
revert-broken-http2.patch
"
options="net" # Required for running tests
[ -n "$BOOTSTRAP" ] && options="$options !check" # remove python3 dependency
@ -200,4 +201,5 @@ libcurl() {
sha512sums="
2008cbc67694f746b7449f087a19b2a9a4950333d6bac1cdc7d80351aa38d8d9b442087dedbc7b0909a419d3b10f510521c942aac012d04a53c32bdb15dce5f0 curl-7.88.0.tar.xz
2e432ba25afab810f4659ed1a9594478c58b957552a38200fffe4b482a570eebde2b467430a355c77260ea2f30e74e90b9e5a2e142160c490ca6ebf4d97d8581 revert-broken-http2.patch
"

View File

@ -0,0 +1,59 @@
From cc07dde6cac5cada7edd0fbf8e899c3ec4f73e62 Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Wed, 15 Feb 2023 19:02:37 +0100
Subject: [PATCH] Revert "http2: minor buffer and error path fixes"
This reverts commit 8c762f59983a3e9e2b80fdb34aa5e08f1d9a1c7d.
---
lib/http2.c | 17 ++++-------------
tests/tests-httpd/test_05_errors.py | 20 +++++++-------------
2 files changed, 11 insertions(+), 26 deletions(-)
diff --git a/lib/http2.c b/lib/http2.c
index 46fc74645..db968ed2d 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -1905,9 +1905,8 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
if(stream->memlen) {
ssize_t retlen = stream->memlen;
-
- /* TODO: all this buffer handling is very brittle */
- stream->len += stream->memlen;
+ DEBUGF(LOG_CF(data, cf, "[h2sid=%u] recv: returns %zd",
+ stream->stream_id, retlen));
stream->memlen = 0;
if(ctx->pause_stream_id == stream->stream_id) {
@@ -1919,10 +1918,6 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
Curl_expire(data, 0, EXPIRE_RUN_NOW);
}
else if(stream->closed) {
- if(stream->reset || stream->error) {
- nread = http2_handle_stream_close(cf, data, stream, err);
- goto out;
- }
/* this stream is closed, trigger a another read ASAP to detect that */
DEBUGF(LOG_CF(data, cf, "[h2sid=%u] is closed now, run again",
stream->stream_id));
@@ -1934,15 +1929,11 @@ static ssize_t cf_h2_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
}
nread = retlen;
- DEBUGF(LOG_CF(data, cf, "[h2sid=%u] cf_h2_recv -> %zd",
- stream->stream_id, nread));
goto out;
}
- if(stream->closed) {
- nread = http2_handle_stream_close(cf, data, stream, err);
- goto out;
- }
+ if(stream->closed)
+ return http2_handle_stream_close(cf, data, stream, err);
if(!data->state.drain && Curl_conn_cf_data_pending(cf->next, data)) {
DEBUGF(LOG_CF(data, cf, "[h2sid=%u] pending data, set drain",
--
2.39.2