Skip to content

Fixes http::async_connection::default_error that always set error flag #567

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

Merged
merged 1 commit into from
Oct 27, 2015
Merged

Conversation

snizovtsev
Copy link

Fixes #271

http::async_conection::write(Range) pass default_error function as callback for asynchronous operation. However, this function doesn't check error_code to 0 (aka success), so async_connection::has_error() is always set after async_connection::write(Range) completition. This causes next async_connection::write(...) calls to throw even if no errors.

I am also suggest to drop boost::optional wrapper of async_connection::error_encountered variable, because boost::system::system_error already have an "empty state" - errc::success.

@deanberris
Copy link
Member

LGTM

Good catch -- thanks @snizovtsev. I like the idea of removing boost::optional from there, so please send in a pull request to fix that there (and in other places) if you don't mind.

Cheers

deanberris added a commit that referenced this pull request Oct 27, 2015
Fixes http::async_connection::default_error that always set error flag
@deanberris deanberris merged commit 9bcbde7 into cpp-netlib:0.11-devel Oct 27, 2015
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

Successfully merging this pull request may close these issues.

2 participants