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

Spurious message: "Leftovers after chunking: X bytes" #12937

Closed
mkauf opened this issue Feb 14, 2024 · 3 comments
Closed

Spurious message: "Leftovers after chunking: X bytes" #12937

mkauf opened this issue Feb 14, 2024 · 3 comments
Labels

Comments

@mkauf
Copy link
Contributor

mkauf commented Feb 14, 2024

I did this

curl 8.6.0 shows the verbose message "Leftovers after chunking: X bytes" when it receives a response with "Transfer-Encoding: chunked".

Example:

$ curl -s -v --http1.1 https://echo.free.beeceptor.com > /dev/null
[...]
< HTTP/1.1 200 OK
< Alt-Svc: h3=":443"; ma=2592000
< Content-Type: application/json
< Date: Wed, 14 Feb 2024 14:40:48 GMT
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< 
{ [5 bytes data]
* Leftovers after chunking: 5 bytes
* Connection #0 to host echo.free.beeceptor.com left intact

"git bisect" found commit d7b6ce6

I expected the following

No message "Leftovers after chunking".

curl 8.2.1 does not have the bug:

curl -s -v --http1.1 https://echo.free.beeceptor.com > /dev/null
[...]
< HTTP/1.1 200 OK
< Alt-Svc: h3=":443"; ma=2592000
< Content-Type: application/json
< Date: Wed, 14 Feb 2024 14:47:05 GMT
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< 
{ [5 bytes data]
* Connection #0 to host echo.free.beeceptor.com left intact

curl/libcurl version

curl 8.6.0

operating system

Fedora Linux 39

@icing
Copy link
Contributor

icing commented Feb 14, 2024

I do not see that, given your example, on my machine, but it may be some timing dependant thing. Will investigate further.

Update: found it. Please see #12939 for the fix.

icing added a commit to icing/curl that referenced this issue Feb 14, 2024
- refs curl#12937
- chunks were handled correctly, but accounting was
  borked so that "left" bytes were reported on the
  last chunk written.
@mkauf
Copy link
Contributor Author

mkauf commented Feb 14, 2024

@icing Great, thanks! I have tested #12939, the message does not appear anymore :-)

@jay jay added the HTTP label Feb 18, 2024
@jay jay closed this as completed in 59e2c78 Feb 18, 2024
@jay
Copy link
Member

jay commented Feb 18, 2024

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants