Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix chunk and content-length encoding#759

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
deanberris merged 2 commits intocpp-netlib:0.13-releasefromLoopinFool:0.13-release-integration
May 15, 2017
Merged

Fix chunk and content-length encoding#759

deanberris merged 2 commits intocpp-netlib:0.13-releasefromLoopinFool:0.13-release-integration
May 15, 2017

Conversation

LoopinFool
Copy link

I used the 0.13-release branch because we're updating an existing application to Visual Studio 2017 and it would build, and build against the latest boost 1.64.

At first, things didn't work at all. After using the simple_wget sample to debug it, I found that a bunch of the content (starting with the headers) had been appended after the BODY. I narrowed it down and fixed the new EOF callback when the server has sent a content-length header.

Next, Visual Studio's iterator debugging found the problem with the "len + 2" statement where it could go beyond the end of the string if the buffer didn't yet contain the crlf terminator after the current chunk. After fixing that, things mostly worked but I encountered an occasional infinite loop. From that state I figured out that the existing logic couldn't handle having a partial chunk in the buffer when checking if the chunks have all been received.

The new chunk handling code isn't overly efficient, but my changes got it to work reliably without any major changes to the partial buffer handling.

LoopinFooland others added2 commitsMay 11, 2017 12:29
Don't potentially access memory beyond the end of the string buffer.In the case of a partial chunk, exit the loop. Continuing to search for crlf in the middle of a binary data chunk can result in an infinite loop, and wasn't the right logic.
@glynos
Copy link
Member

LGTM.

Copy link
Member

@deanberrisdeanberris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM

@deanberrisdeanberris merged commitb930b8e intocpp-netlib:0.13-releaseMay 15, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@deanberrisdeanberrisdeanberris approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@LoopinFool@glynos@deanberris

[8]ページ先頭

©2009-2025 Movatter.jp