Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletionsboost/network/protocol/http/server/async_connection.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -462,11 +462,18 @@ struct async_connection
enum state_t { method, uri, version, headers };

void start() {
typename ostringstream<Tag>::type ip_stream;
ip_stream << socket_.remote_endpoint().address().to_string() << ':'
<< socket_.remote_endpoint().port();
request_.source = ip_stream.str();
read_more(method);
std::error_code ec;
auto remote_endpoint = socket_.remote_endpoint(ec);

if (ec) {
error_encountered = in_place<std::system_error>(ec);
} else {
typename ostringstream<Tag>::type ip_stream;
ip_stream << remote_endpoint.address().to_string() << ':'
<< remote_endpoint.port();
request_.source = ip_stream.str();
read_more(method);
}
}

void read_more(state_t state) {
Expand Down
15 changes: 12 additions & 3 deletionsboost/network/protocol/stream_handler.hpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,12 +109,21 @@ struct stream_handler {
}
}

tcp_socket::endpoint_type remote_endpoint() const {
tcp_socket::endpoint_type remote_endpoint(std::error_code& ec) const {
if (ssl_enabled) {
return ssl_sock_->next_layer().remote_endpoint();
return ssl_sock_->next_layer().remote_endpoint(ec);
} else {
return tcp_sock_->remote_endpoint();
return tcp_sock_->remote_endpoint(ec);
}
}

tcp_socket::endpoint_type remote_endpoint() const {
std::error_code ec;
tcp_socket::endpoint_type r = remote_endpoint(ec);
if (ec) {
::asio::detail::throw_error(ec, "remote_endpoint");
}
return r;
}

void shutdown(::asio::socket_base::shutdown_type st,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp