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

Body callback function is not called when some errors occur (timeout etc.) #640

Closed
gbkrk opened this issue Apr 20, 2016 · 0 comments
Closed

Comments

@gbkrk
Copy link

gbkrk commented Apr 20, 2016

When using cpp-netlib-0.11.2-final and async client with body callback function:

boost::network::http::client::options options;
options.timeout( timeout_seconds );
options.follow_redirects( true );

boost::network::http::client client( options );
client.get( request, callback );

The callback is not called when some network etc. errors occur. I observed it that when timeout should occur my callback function is still not called, but when I looked at cpp-netlib's async_normal.hpp file I found not only for timeout, but in many places in which body_promise IS set (either to empty value or exception), but callback either IS NOT called at all, or is called with uninitialized boost::system::error_code instead of the same error code body_promise was set, which would make my own callback function expect another call instead of finish the processing (since uninitialized error_code means no error occurred and we are still waiting for boost::asio::error::eof or other error to finish the processing).

The issue is also present on the current master branch. I created a pull request with proposed fix for this.

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

No branches or pull requests

2 participants