Skip to content
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

Regression: CURLINFO_REQUEST_SIZE returns 0 when the response is aborted #13269

Closed
ergonjona opened this issue Apr 3, 2024 · 5 comments
Closed

Comments

@ergonjona
Copy link

I did this

curl_easy_getinfo(curlh, CURLINFO_REQUEST_SIZE, &request_size); on a request hat was aborted during the response (incomplete response).

I expected the following

request_size should be greater than 0.

This was the case with Version 8.6.0

curl/libcurl version

8.7.1

operating system

Linux la_luna 6.8.2-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 28 Mar 2024 17:06:35 +0000 x86_64 GNU/Linux

@ergonjona
Copy link
Author

This is reproducible with the curl binary.

Request: curl --write-out "%{size_request}\n" localhost:8080

The response must be cut short, e.g:

HTTP/1.1 200 OK
Date: Wed, 03 Apr 2024 08:09:55 GMT
Content-Length: 215
Content-Type: text/html; charset=iso-8859-1

<html>

I Did this with nc -l -p 8080, copy&pasting the response and aborting the response with Ctrl-C.

With curl version 8.6.0 the output is:

<html>
curl: (18) transfer closed with 208 bytes remaining to read
size_request: 77

With curl version 8.7.1 the output is:

<html>
curl: (18) transfer closed with 208 bytes remaining to read
size_request: 0

@mkauf mkauf changed the title CURLINFO_REQUEST_SIZE returns 0 when the response is aborted Regression: CURLINFO_REQUEST_SIZE returns 0 when the response is aborted Apr 3, 2024
@bagder

This comment was marked as outdated.

@mkauf
Copy link
Contributor

mkauf commented Apr 3, 2024

First bad commit, found with git bisect: 3755153

icing added a commit to icing/curl that referenced this issue Apr 4, 2024
- refs curl#13269
- tests for 'size_request' and other stats reported, for
  presence and consistency
@icing
Copy link
Contributor

icing commented Apr 4, 2024

Please see #13275 for a fix.

@ergonjona
Copy link
Author

#13275 fixed our issue.

Thank you!

@bagder bagder closed this as completed in 8482ce5 Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants