-
Notifications
You must be signed in to change notification settings - Fork 424
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
Sizes in body when using client.post() #110
Comments
I use cpp-netlib-0.9.3 and boost_1_49_0 |
#69 - Hasn't been fixed yet I guess. |
This is a bug -- and Divye is right this hasn't been fixed yet. Would anybody else be willing to submit a pull request for this? I can certainly take a look at this but I'll be busy with large-churn efforts in the meantime for other parts of the library. |
This bug appears in the async implementation in 0.9.4. It occurs because the body handler is not handling chunked encoding and the chunk sizes are being incorporated into the text of the body |
As mentioned above, the body handler does not handle chunked encoding. Here is a quick fix. Use the function below instead of body() to obtain the body. For example std::string body = chunked_body(response); std::string chunked_body(boost::network::http::client::response& response){
} |
Hi jbandela, I found a small issue in chunked_body() . I added "iter +=2" as below, it works fine. Hope it helps. if(!len) break; |
I just remembered this sitting on my inbox. Can you make this part of the actual parsing implementation for the body in 0.9-devel? I'm looking to release 0.9.5 soon and would love to have this fixed in that version. |
I've added my attempt at integrating jbandela's function into the codebase as a pull request. Not entirely sure is it's in the correct place, but it appears to be fixing the issue for me. |
Hello,
When I do
curl -d "q=%3A&version=2.2&start=0&rows=10&indent=on" http://192.168.0.202:8080/solr/lg_fr_alpha4/select/?
the ouput XML stream is fine. When I use wireshark I can see in the middle of the XML stream, some size values once in a while:
2000
name="in_stock_format">0
breaking the XML. I guess that's part of the HTTP Post protocol. When I use:
The "2000" size values appears also in "myString". What is the right way to use http::client or response such that this size values disappear from myString ??? Thank you.
The text was updated successfully, but these errors were encountered: