- Notifications
You must be signed in to change notification settings - Fork425
Fix #677: Exception in async_server_base/async_connection during port scanning (nmap)#678
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
glynos commentedAug 10, 2016
@vovams sorry, the 0.12-release branch is not correct. Please apply the PR to the0.13-release branch. The PR looks good, though. |
vovams commentedAug 11, 2016
I can adapt the fix for 0.13, but what about 0.12? I wanted to merge the fix into it because i am using 0.12 in my project. |
deanberris commentedAug 11, 2016
@glynos -- Do you think it's OK for us to pull this in then release a 0.12.1 to address just this issue? |
glynos commentedAug 11, 2016
@deanberris -- No, we agreed that some changes in 0.12 were mistakenly added, and reverted those changes in 0.13. We are slow to release a 0.13 version, but I think this should be a part of it. |
deanberris commentedAug 11, 2016
Okay, SGTM. |
vovams commentedAug 11, 2016
I do not know your release plans, but branch 0.12-release currently contains some other fixes as well. For example,79aaa62, because of which i had to switch my project from cpp-netlib-0.12.0-final tag to the tip of 0.12-release. So a bugfix release might be useful. Anyway, i opened new pull request for 0.13-release:#679. |
Fix for issue#677.
During a port scan
async_server_base::handle_accept()may be called while the connection is not properly established. No error code is passed tohandel_accept()(i.e.!!ec == false) but the subsequent call toasync_connection::start()->stream_handler::remote_endpoint()->asio::basic_socket::remote_endpoint()fails with an exception.My fix is to add error checking by using
asio::basic_socket::remote_endpoint(asio::error_code&)overload instream_handler::remote_endpoint()and passing the error toasync_connection::start().Since i had to change signature of
stream_handler::remote_endpoint(), i added a new overload with old signature and behavior to keep any code which uses it working.