-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libcurl 8.3.0 erroneously closes paused transfers with unknown content-length #11982
Comments
Get full trace info by applying this: --- issue-11982.c~ 2023-09-29 08:40:42.643369656 +0200
+++ issue-11982.c 2023-09-29 08:41:46.012406540 +0200
@@ -55,6 +55,7 @@
int rc = 1;
curl_global_init(CURL_GLOBAL_DEFAULT);
+ curl_global_trace("all");
for(i = 0; i<HANDLECOUNT; i++) {
handles[i].idx = i;
@@ -64,6 +65,7 @@
curl_easy_setopt(handles[i].h, CURLOPT_WRITEFUNCTION, cb) != CURLE_OK ||
curl_easy_setopt(handles[i].h, CURLOPT_WRITEDATA, &handles[i]) != CURLE_OK ||
curl_easy_setopt(handles[i].h, CURLOPT_FOLLOWLOCATION, 1L) != CURLE_OK ||
+ curl_easy_setopt(handles[i].h, CURLOPT_VERBOSE, 1L) != CURLE_OK ||
curl_easy_setopt(handles[i].h, CURLOPT_URL,
"https://www.meteoblue.com/en") != CURLE_OK) {
err(); |
Here's a 900 line output from my run when reperoducing.
|
Made this into a test case. The scenario is as follows:
One could be tempted to argue that the h2 cfilter should not set DRAIN for PAUSED transfers, but that wold not solve the issue. On the first read, the transfer is not PAUSED yet and DRAIN needs to be set by the filter. The PAUSE happens when transfer does the client write afterwards. The DRAIN and EXPIRE then is already on its way. We need to change transfer to handle PAUSED handles in a better way. |
Clearly a paused transfer cannot be considered done in (7). It needs to get that state stored and handled though, so that when later unpaused it can just delivere the cached data and then die. |
- refs curl#11982 where it was noted that paused transfers may close successfully without delivering the complete data - made sample poc into tests/http/client/h2-pausing.c and added test_02_27 to reproduce
Made this into a test case and proposed fix at #11989. It's a small change, maybe you could verify this as patch into your 8.3.0 setup? |
Works for me now, both in the test app and in the Webkit based browser when using the libcurl backend. 👍🏻 |
Thanks for reporting this @piru ! I was doing some smoke testing on updated requirements for the Windows WebKit port and https://webkit.org was not loading. After this patch it loads successfully @icing . Thanks! |
I did this
I expected the following
Both connections to get paused and neither complete.
curl/libcurl version
libcurl 8.3.0
operating system
Linux hostname 6.3.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.3.11-1 (2023-07-01) x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: