summaryrefslogtreecommitdiff
path: root/net-misc/curl
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/curl')
-rw-r--r--net-misc/curl/Manifest4
-rw-r--r--net-misc/curl/curl-8.7.1-r2.ebuild (renamed from net-misc/curl/curl-8.7.1-r1.ebuild)0
-rw-r--r--net-misc/curl/files/curl-8.7.1-chunked-post.patch57
-rw-r--r--net-misc/curl/files/curl-8.7.1-fix-compress-option.patch153
4 files changed, 213 insertions, 1 deletions
diff --git a/net-misc/curl/Manifest b/net-misc/curl/Manifest
index 0da7bcbf2cd0..59e3c3f40a18 100644
--- a/net-misc/curl/Manifest
+++ b/net-misc/curl/Manifest
@@ -2,6 +2,8 @@ AUX curl-8.5.0-ipv6-configure-c99.patch 749 BLAKE2B b9d94d4ec5c310f8d3985eb6e4a1
AUX curl-8.5.0-mpd-stream-http-adjust_pollset.patch 2979 BLAKE2B da34eb58eb8b706916657279bc071ab97145e33e7e7eb553ffe924be7a97e3d784d5e2fc8270363e95e815687201b6fae1b374dc666093441c5177bfe76eb835 SHA512 11ed5f8482d985aab4e7ab07f0e8821d76a494d0147a61ce7901379cd1f36f577c544627f5ad61a38b70e9e4659fc050c5b9e0be4247ab410f55850a946872d1
AUX curl-8.6.0-rustls-fixes.patch 8210 BLAKE2B 8c25023f84ba897eca22d53937259131d8c6032d428ec2ef6f7d696a2634fbb2af298228463209a170bd7ab0ee40f0975a01a331dced24d1ea51c935a3d3b3be SHA512 8737a18d03b1f159c69864e127087bf297077c546ab5a05ff01977a9dfc9e8cf2d4ae14a4091e8f1d8aedcd4f6de894f0b5374baaaf4413bff9bd6de6165a556
AUX curl-8.6.0-vtls-revert-receive-max-buffer-add-test-case.patch 2028 BLAKE2B b018e0fc5649b558e732a903eafe1249575829613b129ceaaaeeae3c7fc9f5c237c3688067c2370dc3ad1d67632acdfb805efa93db4e8bd8d6dd8b2f5043e2b5 SHA512 d8d4eb0b294d243f5c241e0243ca41e28b12aa8804a4f8c73e2ab70edd52de9be2b7a26b706085e10ae4a9c31545112cd4b68dcda6647571bb8d5528b7625de6
+AUX curl-8.7.1-chunked-post.patch 2389 BLAKE2B d283816be5dca19ab0058db1937d686b4f9056caf3c46a8dcd731bc69ae91df1b01d10f643ce127eeec7aac0e9282f8b5c5109fe1cea82b30d2cf3270e93ae24 SHA512 3b1a67010704f4863f973e79d6a695e6e13b938fbaa695a05bc92b1a577fa5852c310b38f9c88518275f82c7d088474f5e4c585ac5ff790043e6ca969b0dc1d9
+AUX curl-8.7.1-fix-compress-option.patch 6222 BLAKE2B 7ff5c096fa6cc5cc039f47188a85c49364cdfe6cfeae3a9c58b38939eb59896bcf204c682f36e89ace37a0753236593307e1af45bc2d0f099ff685af8e366713 SHA512 1622adf015a016a205d4bf621715ed06fd345cd45f032ad44b6d9324d398c0e2004f04fe734401b12007c3eb145dac84aa3ce90bdaa9b16e09b5908da75f902f
AUX curl-8.7.1-rustls-fixes.patch 1526 BLAKE2B c1ce730bc1d78d9655378a174b32706bc964e07b1b4fde5385212542bf0c85b2adfa8110266410b6d8766bb2ca5c46a58295d7098ab4acb71acb0a5dbd6d5d20 SHA512 7ca3004306595ead6057bbbfa6dcbb5d7b8b7782a7627e5607a916fff8626b4c3bfb2cbac48aa0e65a93b3c4fb0f87a7ee09273f1f9b1eadb9126fbcc4a72ce2
AUX curl-prefix.patch 880 BLAKE2B 5b7552a8339014221864a585d174b02a96ec7dd7fe8762d331d1981834044f8ec4db64d527a4ded3f5f4cccc86f281576668de092439eb19f5477d5fcf8369cf SHA512 c7cd13b9ccbd12ed01ea121ffece9c23b898a5b34698bae59ae1dd23b1cf2445180b84d80c4a640981f16dba5018df944f405dd5c660addab54ca21e0e673b7f
AUX curl-respect-cflags-3.patch 406 BLAKE2B 1b533144858aff5566150c4a2648ad2e48e8ff29849ae285592edfee4b3332d06e750395dea7190ee6a01d2b5ee2c2c42c10400c2e5defa09963a90a1a10417d SHA512 3219e4e67d534e35012909243fc8d69d58989462db44dd507c502e7aaa299f1d9a01392e2c83797cc2bdb53d503470c5d6e7bf94572a6ccc6e5eafcc0466bc54
@@ -13,6 +15,6 @@ DIST curl-8.7.1.tar.xz 2707016 BLAKE2B a2a9f48d0b69c0d92fcbbda535ce55082a5243abe
DIST curl-8.7.1.tar.xz.asc 488 BLAKE2B 1c91d116aecc8e98d8ec3aad68b7c96f11151e6c2716f531e5d2989e9b6b1199e180603673891d7967cdcdaee1d6b5e15160ccabe9b51590e2887022db03c2ed SHA512 f98c393997c4a32f545a8982226e8cd612395210915a4576c2ce227d0f650cff341be7bf15e989d1789abf32ac4fd9c190b9250b81e650b569e8532048746b37
EBUILD curl-8.5.0-r3.ebuild 11079 BLAKE2B 6d975ad2d3591ea6de6a248ddd1acb049f0cd5d0a371eb487c6a4d193084a5e684673bd55860ac838a48a4c66d11f778b37a253bd325abba5ab545a65bd1bfb5 SHA512 33b5a05de99819327fac0af5ec94790be3953086b2996cb6628cbfb6be959f64a6b5a8d2015371eacd6945be768e3fe1bae67773b512599d127c298c66858c91
EBUILD curl-8.6.0-r2.ebuild 10882 BLAKE2B 1d706f59390420fae5c19b6615aa6cf07387e0d53ef90d5dcabc9aa75c1435eb89f587f9dda1c9a179b5c71a86897a80008a847145bce2216bcb6a22e1345ad2 SHA512 5f48ab69e84695c8b25675ba5bf32072a74f12e488d30dce653447a65d21f1be0f2a2a34f77608939ed0bd2763e3a86c1ab8b57312f691815b6ce93bf424383d
-EBUILD curl-8.7.1-r1.ebuild 10869 BLAKE2B 405e8cc4d0c6ec696d7b6fa97330d3ff6cfb6420cc7239cd56df3416066f6309093f6eba23a3cca964b6ca98850b7e9de785c81a2a42a4fafc31e70a1258dfe1 SHA512 c1914cae9f108a386c39bd1def774e77acfeb617da093fd2ad48c1e47cdd75b53cf5dd20bfdd4f4201518b76f76798013d99e3e27c337d7e2f91d619018a1335
+EBUILD curl-8.7.1-r2.ebuild 10869 BLAKE2B 405e8cc4d0c6ec696d7b6fa97330d3ff6cfb6420cc7239cd56df3416066f6309093f6eba23a3cca964b6ca98850b7e9de785c81a2a42a4fafc31e70a1258dfe1 SHA512 c1914cae9f108a386c39bd1def774e77acfeb617da093fd2ad48c1e47cdd75b53cf5dd20bfdd4f4201518b76f76798013d99e3e27c337d7e2f91d619018a1335
EBUILD curl-9999.ebuild 10771 BLAKE2B 48c610c3ea379320360d48a6473b9db17f7d8ffb895fde8e602e14822f5d8d56d2a9fc499f1302a4bb941581a9b8e082b1aa799222c8aa9c9faf546776ba671a SHA512 9afd073cdbb994726349e8ffd33ab994e64b0fc1f19574343bb0f22953dbb16471b332271478bf0d016c709f82acdf633075c9b55daf286dea9ffa5a927bb6de
MISC metadata.xml 2090 BLAKE2B 54d366aadfc25650c40081ff10eb150bcb9811a29f802c418afce166c384e2bafc999ff7e69ceeb25a96e952d4875d808e8e89240b437741cd363fab46267a25 SHA512 2103a849b67f9a14a85eb769b870e7272bf8f9c78ca579b4271150be01f26787a884614bff874d50f90be99af4a6ecb136510fca2837463e0bc91611ddbeae40
diff --git a/net-misc/curl/curl-8.7.1-r1.ebuild b/net-misc/curl/curl-8.7.1-r2.ebuild
index f81f4b76f480..f81f4b76f480 100644
--- a/net-misc/curl/curl-8.7.1-r1.ebuild
+++ b/net-misc/curl/curl-8.7.1-r2.ebuild
diff --git a/net-misc/curl/files/curl-8.7.1-chunked-post.patch b/net-misc/curl/files/curl-8.7.1-chunked-post.patch
new file mode 100644
index 000000000000..9d1fef73d383
--- /dev/null
+++ b/net-misc/curl/files/curl-8.7.1-chunked-post.patch
@@ -0,0 +1,57 @@
+https://github.com/curl/curl/commit/721941aadf4adf4f6aeb3f4c0ab489bb89610c36
+From: Stefan Eissing <stefan@eissing.org>
+Date: Mon, 1 Apr 2024 15:41:18 +0200
+Subject: [PATCH] http: with chunked POST forced, disable length check on read
+ callback
+
+- when an application forces HTTP/1.1 chunked transfer encoding
+ by setting the corresponding header and instructs curl to use
+ the CURLOPT_READFUNCTION, disregard any POST length information.
+- this establishes backward compatibility with previous curl versions
+
+Applications are encouraged to not force "chunked", but rather
+set length information for a POST. By setting -1, curl will
+auto-select chunked on HTTP/1.1 and work properly on other HTTP
+versions.
+
+Reported-by: Jeff King
+Fixes #13229
+Closes #13257
+--- a/lib/http.c
++++ b/lib/http.c
+@@ -2046,8 +2046,19 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
+ else
+ result = Curl_creader_set_null(data);
+ }
+- else { /* we read the bytes from the callback */
+- result = Curl_creader_set_fread(data, postsize);
++ else {
++ /* we read the bytes from the callback. In case "chunked" encoding
++ * is forced by the application, we disregard `postsize`. This is
++ * a backward compatibility decision to earlier versions where
++ * chunking disregarded this. See issue #13229. */
++ bool chunked = FALSE;
++ char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
++ if(ptr) {
++ /* Some kind of TE is requested, check if 'chunked' is chosen */
++ chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"),
++ STRCONST("chunked"));
++ }
++ result = Curl_creader_set_fread(data, chunked? -1 : postsize);
+ }
+ return result;
+
+@@ -2115,6 +2126,13 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
+ data->req.upload_chunky =
+ Curl_compareheader(ptr,
+ STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
++ if(data->req.upload_chunky &&
++ Curl_use_http_1_1plus(data, data->conn) &&
++ (data->conn->httpversion >= 20)) {
++ infof(data, "suppressing chunked transfer encoding on connection "
++ "using HTTP version 2 or higher");
++ data->req.upload_chunky = FALSE;
++ }
+ }
+ else {
+ curl_off_t req_clen = Curl_creader_total_length(data);
diff --git a/net-misc/curl/files/curl-8.7.1-fix-compress-option.patch b/net-misc/curl/files/curl-8.7.1-fix-compress-option.patch
new file mode 100644
index 000000000000..a06a53729533
--- /dev/null
+++ b/net-misc/curl/files/curl-8.7.1-fix-compress-option.patch
@@ -0,0 +1,153 @@
+https://github.com/curl/curl/commit/b30d694a027eb771c02a3db0dee0ca03ccab7377
+From: Stefan Eissing <stefan@eissing.org>
+Date: Thu, 28 Mar 2024 11:08:15 +0100
+Subject: [PATCH] content_encoding: brotli and others, pass through 0-length
+ writes
+
+- curl's transfer handling may write 0-length chunks at the end of the
+ download with an EOS flag. (HTTP/2 does this commonly)
+
+- content encoders need to pass-through such a write and not count this
+ as error in case they are finished decoding
+
+Fixes #13209
+Fixes #13212
+Closes #13219
+--- a/lib/content_encoding.c
++++ b/lib/content_encoding.c
+@@ -300,7 +300,7 @@ static CURLcode deflate_do_write(struct Curl_easy *data,
+ struct zlib_writer *zp = (struct zlib_writer *) writer;
+ z_stream *z = &zp->z; /* zlib state structure */
+
+- if(!(type & CLIENTWRITE_BODY))
++ if(!(type & CLIENTWRITE_BODY) || !nbytes)
+ return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
+
+ /* Set the compressed input when this function is called */
+@@ -457,7 +457,7 @@ static CURLcode gzip_do_write(struct Curl_easy *data,
+ struct zlib_writer *zp = (struct zlib_writer *) writer;
+ z_stream *z = &zp->z; /* zlib state structure */
+
+- if(!(type & CLIENTWRITE_BODY))
++ if(!(type & CLIENTWRITE_BODY) || !nbytes)
+ return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
+
+ if(zp->zlib_init == ZLIB_INIT_GZIP) {
+@@ -669,7 +669,7 @@ static CURLcode brotli_do_write(struct Curl_easy *data,
+ CURLcode result = CURLE_OK;
+ BrotliDecoderResult r = BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT;
+
+- if(!(type & CLIENTWRITE_BODY))
++ if(!(type & CLIENTWRITE_BODY) || !nbytes)
+ return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
+
+ if(!bp->br)
+@@ -762,7 +762,7 @@ static CURLcode zstd_do_write(struct Curl_easy *data,
+ ZSTD_outBuffer out;
+ size_t errorCode;
+
+- if(!(type & CLIENTWRITE_BODY))
++ if(!(type & CLIENTWRITE_BODY) || !nbytes)
+ return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
+
+ if(!zp->decomp) {
+@@ -916,7 +916,7 @@ static CURLcode error_do_write(struct Curl_easy *data,
+ (void) buf;
+ (void) nbytes;
+
+- if(!(type & CLIENTWRITE_BODY))
++ if(!(type & CLIENTWRITE_BODY) || !nbytes)
+ return Curl_cwriter_write(data, writer->next, type, buf, nbytes);
+
+ failf(data, "Unrecognized content encoding type. "
+--- a/tests/http/test_02_download.py
++++ b/tests/http/test_02_download.py
+@@ -394,6 +394,19 @@ def test_02_27_paused_no_cl(self, env: Env, httpd, nghttpx, repeat):
+ r = client.run(args=[url])
+ r.check_exit_code(0)
+
++ @pytest.mark.parametrize("proto", ['http/1.1', 'h2', 'h3'])
++ def test_02_28_get_compressed(self, env: Env, httpd, nghttpx, repeat, proto):
++ if proto == 'h3' and not env.have_h3():
++ pytest.skip("h3 not supported")
++ count = 1
++ urln = f'https://{env.authority_for(env.domain1brotli, proto)}/data-100k?[0-{count-1}]'
++ curl = CurlClient(env=env)
++ r = curl.http_download(urls=[urln], alpn_proto=proto, extra_args=[
++ '--compressed'
++ ])
++ r.check_exit_code(code=0)
++ r.check_response(count=count, http_status=200)
++
+ def check_downloads(self, client, srcfile: str, count: int,
+ complete: bool = True):
+ for i in range(count):
+--- a/tests/http/testenv/env.py
++++ b/tests/http/testenv/env.py
+@@ -129,10 +129,11 @@ def __init__(self):
+ self.htdocs_dir = os.path.join(self.gen_dir, 'htdocs')
+ self.tld = 'http.curl.se'
+ self.domain1 = f"one.{self.tld}"
++ self.domain1brotli = f"brotli.one.{self.tld}"
+ self.domain2 = f"two.{self.tld}"
+ self.proxy_domain = f"proxy.{self.tld}"
+ self.cert_specs = [
+- CertificateSpec(domains=[self.domain1, 'localhost'], key_type='rsa2048'),
++ CertificateSpec(domains=[self.domain1, self.domain1brotli, 'localhost'], key_type='rsa2048'),
+ CertificateSpec(domains=[self.domain2], key_type='rsa2048'),
+ CertificateSpec(domains=[self.proxy_domain, '127.0.0.1'], key_type='rsa2048'),
+ CertificateSpec(name="clientsX", sub_specs=[
+@@ -376,6 +377,10 @@ def htdocs_dir(self) -> str:
+ def domain1(self) -> str:
+ return self.CONFIG.domain1
+
++ @property
++ def domain1brotli(self) -> str:
++ return self.CONFIG.domain1brotli
++
+ @property
+ def domain2(self) -> str:
+ return self.CONFIG.domain2
+--- a/tests/http/testenv/httpd.py
++++ b/tests/http/testenv/httpd.py
+@@ -50,6 +50,7 @@ class Httpd:
+ 'alias', 'env', 'filter', 'headers', 'mime', 'setenvif',
+ 'socache_shmcb',
+ 'rewrite', 'http2', 'ssl', 'proxy', 'proxy_http', 'proxy_connect',
++ 'brotli',
+ 'mpm_event',
+ ]
+ COMMON_MODULES_DIRS = [
+@@ -203,6 +204,7 @@ def _mkpath(self, path):
+
+ def _write_config(self):
+ domain1 = self.env.domain1
++ domain1brotli = self.env.domain1brotli
+ creds1 = self.env.get_credentials(domain1)
+ domain2 = self.env.domain2
+ creds2 = self.env.get_credentials(domain2)
+@@ -285,6 +287,24 @@ def _write_config(self):
+ f'</VirtualHost>',
+ f'',
+ ])
++ # Alternate to domain1 with BROTLI compression
++ conf.extend([ # https host for domain1, h1 + h2
++ f'<VirtualHost *:{self.env.https_port}>',
++ f' ServerName {domain1brotli}',
++ f' Protocols h2 http/1.1',
++ f' SSLEngine on',
++ f' SSLCertificateFile {creds1.cert_file}',
++ f' SSLCertificateKeyFile {creds1.pkey_file}',
++ f' DocumentRoot "{self._docs_dir}"',
++ f' SetOutputFilter BROTLI_COMPRESS',
++ ])
++ conf.extend(self._curltest_conf(domain1))
++ if domain1 in self._extra_configs:
++ conf.extend(self._extra_configs[domain1])
++ conf.extend([
++ f'</VirtualHost>',
++ f'',
++ ])
+ conf.extend([ # https host for domain2, no h2
+ f'<VirtualHost *:{self.env.https_port}>',
+ f' ServerName {domain2}',