summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/curl
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/curl')
-rw-r--r--meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch64
-rw-r--r--meta/recipes-support/curl/curl/run-ptest4
-rw-r--r--meta/recipes-support/curl/curl_8.7.1.bb5
3 files changed, 70 insertions, 3 deletions
diff --git a/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch b/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch
new file mode 100644
index 0000000000..98f7db93e8
--- /dev/null
+++ b/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch
@@ -0,0 +1,64 @@
1From 721941aadf4adf4f6aeb3f4c0ab489bb89610c36 Mon Sep 17 00:00:00 2001
2From: Stefan Eissing <stefan@eissing.org>
3Date: Mon, 1 Apr 2024 15:41:18 +0200
4Subject: [PATCH] http: with chunked POST forced, disable length check on read
5 callback
6
7- when an application forces HTTP/1.1 chunked transfer encoding
8 by setting the corresponding header and instructs curl to use
9 the CURLOPT_READFUNCTION, disregard any POST length information.
10- this establishes backward compatibility with previous curl versions
11
12Applications are encouraged to not force "chunked", but rather
13set length information for a POST. By setting -1, curl will
14auto-select chunked on HTTP/1.1 and work properly on other HTTP
15versions.
16
17Reported-by: Jeff King
18Fixes #13229
19Closes #13257
20Upstream-Status: Backport
21---
22 lib/http.c | 22 ++++++++++++++++++++--
23 1 file changed, 20 insertions(+), 2 deletions(-)
24
25diff --git a/lib/http.c b/lib/http.c
26index 92c04e69cd8373..a764d3c4403c39 100644
27--- a/lib/http.c
28+++ b/lib/http.c
29@@ -2046,8 +2046,19 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq)
30 else
31 result = Curl_creader_set_null(data);
32 }
33- else { /* we read the bytes from the callback */
34- result = Curl_creader_set_fread(data, postsize);
35+ else {
36+ /* we read the bytes from the callback. In case "chunked" encoding
37+ * is forced by the application, we disregard `postsize`. This is
38+ * a backward compatibility decision to earlier versions where
39+ * chunking disregarded this. See issue #13229. */
40+ bool chunked = FALSE;
41+ char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding"));
42+ if(ptr) {
43+ /* Some kind of TE is requested, check if 'chunked' is chosen */
44+ chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"),
45+ STRCONST("chunked"));
46+ }
47+ result = Curl_creader_set_fread(data, chunked? -1 : postsize);
48 }
49 return result;
50
51@@ -2115,6 +2126,13 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data,
52 data->req.upload_chunky =
53 Curl_compareheader(ptr,
54 STRCONST("Transfer-Encoding:"), STRCONST("chunked"));
55+ if(data->req.upload_chunky &&
56+ Curl_use_http_1_1plus(data, data->conn) &&
57+ (data->conn->httpversion >= 20)) {
58+ infof(data, "suppressing chunked transfer encoding on connection "
59+ "using HTTP version 2 or higher");
60+ data->req.upload_chunky = FALSE;
61+ }
62 }
63 else {
64 curl_off_t req_clen = Curl_creader_total_length(data);
diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest
index 3d25f3d90b..579b3f4587 100644
--- a/meta/recipes-support/curl/curl/run-ptest
+++ b/meta/recipes-support/curl/curl/run-ptest
@@ -7,5 +7,7 @@ cd tests
7# Use automake-style output 7# Use automake-style output
8# Run four tests in parallel 8# Run four tests in parallel
9# Print log output on failure 9# Print log output on failure
10
10# Don't run the flaky or timing dependent tests 11# Don't run the flaky or timing dependent tests
11./runtests.pl -a -n -am -j4 -p !flaky !timing-dependent 12# Until https://github.com/curl/curl/issues/13350 is resolved, don't run FTP tests
13./runtests.pl -a -n -am -j4 -p !flaky !timing-dependent !FTP
diff --git a/meta/recipes-support/curl/curl_8.7.1.bb b/meta/recipes-support/curl/curl_8.7.1.bb
index c6654bbad6..23b7c50a86 100644
--- a/meta/recipes-support/curl/curl_8.7.1.bb
+++ b/meta/recipes-support/curl/curl_8.7.1.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=eed2e5088e1ac619c9a1c747da291d75"
11 11
12SRC_URI = " \ 12SRC_URI = " \
13 https://curl.se/download/${BP}.tar.xz \ 13 https://curl.se/download/${BP}.tar.xz \
14 file://721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch \
14 file://run-ptest \ 15 file://run-ptest \
15 file://disable-tests \ 16 file://disable-tests \
16 file://no-test-timeout.patch \ 17 file://no-test-timeout.patch \
@@ -102,7 +103,7 @@ do_compile_ptest() {
102} 103}
103 104
104do_install_ptest() { 105do_install_ptest() {
105 cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED 106 cat ${UNPACKDIR}/disable-tests >> ${S}/tests/data/DISABLED
106 rm -f ${B}/tests/configurehelp.pm 107 rm -f ${B}/tests/configurehelp.pm
107 cp -rf ${B}/tests ${D}${PTEST_PATH} 108 cp -rf ${B}/tests ${D}${PTEST_PATH}
108 rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la 109 rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la
@@ -119,6 +120,7 @@ do_install_ptest() {
119 120
120RDEPENDS:${PN}-ptest += " \ 121RDEPENDS:${PN}-ptest += " \
121 bash \ 122 bash \
123 locale-base-en-us \
122 perl-module-b \ 124 perl-module-b \
123 perl-module-base \ 125 perl-module-base \
124 perl-module-cwd \ 126 perl-module-cwd \
@@ -134,7 +136,6 @@ RDEPENDS:${PN}-ptest += " \
134 perl-module-storable \ 136 perl-module-storable \
135 perl-module-time-hires \ 137 perl-module-time-hires \
136" 138"
137RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us"
138 139
139PACKAGES =+ "lib${BPN}" 140PACKAGES =+ "lib${BPN}"
140 141