Incorrect Body Processing #69

Closed
divyekapoor opened this Issue Sep 27, 2011 · 7 comments

Projects

None yet

4 participants

@divyekapoor

The file boost/network/protocol/http/client/connection/sync_base.hpp line 110 onwards binary copy the entire streambuf object into the response body. This is incorrect as only the data portion present in the streambuf needs to be copied into the response object.

@deanberris
Member

Thanks for filing the bug. Unfortunately the synchronous implementation will be going away after the core refactoring is completed. I find no more reason to maintain the synchronous client implementation as the asynchronous implementation is more efficient and maintains the API that the synchronous client provides.

Thoughts?

@divyekapoor

This bug affects even the async API (in fact, I stumbled upon it while
implementing an async example) as the erroneous code is in the HTTP body
processing/parsing code. (That particular function is being called from the
async code too while obtaining data for the body handler callback).

As of now, what this bug actually means is that the result obtained from
http::body(response) is incorrect and so is the result obtained via async
callbacks. This is quite a major regression. Thus, I believe that attempts
to fix this bug should be made before the next release.

@deanberris
Member

Ah, okay. Patches welcome if you have time to get to it, otherwise it would have to wait.

@omalashenko

Confirmed in 0.9.3 and master.
Tested with example/fileserver and example/http_client to get data.
http_client sometimes gives lots of trash after data, sometimes hangs.
Firefox receives the data ok.

@Mike-ECT

push ;-)
It's quite a serious issue, I think. I have fixed it for my application (in the cpp-netlib), where the issue occurred, but I broke something else for my other applications. Fortunately, they can use a separate copy of the lib. :/
So you don't want my patch, really. To be honest, I don't understand all the code, so it's not a big surprise I broke it. But maybe someone knowledgeable of the code could fix it soon?

@deanberris
Member

Thanks for the nudge Mike. Unfortunately I won't be able to get to
this (or any cpp-netlib work) until later in the year -- say around
October -- as I have quite a workload right now. Maybe if you can
bring your solution to the list, others might be able to help you
bring it up to a point that actually fixes this?

Cheers

On Thu, Jul 26, 2012 at 10:49 PM, Mike-ECT
reply@reply.github.com
wrote:

push ;-)
It's quite a serious issue, I think. I have fixed it for my application (in the cpp-netlib), where the issue occurred, but I broke something else for my other applications. Fortunately, they can use a separate copy of the lib. :/
So you don't want my patch, really. To be honest, I don't understand all the code, so it's not a big surprise I broke it. But maybe someone knowledgeable of the code could fix it soon?


Reply to this email directly or view it on GitHub:
#69 (comment)

Dean Michael Berris
Technical Solutions Engineer
Google

@deanberris
Member

So I think this is already fixed in 0.10.x -- please reopen if this is still an issue.

@deanberris deanberris closed this Aug 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment