mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 02:28:53 +08:00
asio: Fix bug that server event loop breaks with exception
This can happen when we call throwing version of basic_stream_socket::remote_endpoint() call while client disconnected.
This commit is contained in:
@@ -79,8 +79,10 @@ public:
|
|||||||
|
|
||||||
/// Start the first asynchronous operation for the connection.
|
/// Start the first asynchronous operation for the connection.
|
||||||
void start() {
|
void start() {
|
||||||
|
boost::system::error_code ec;
|
||||||
|
|
||||||
handler_ = std::make_shared<http2_handler>(
|
handler_ = std::make_shared<http2_handler>(
|
||||||
socket_.get_io_service(), socket_.lowest_layer().remote_endpoint(),
|
socket_.get_io_service(), socket_.lowest_layer().remote_endpoint(ec),
|
||||||
[this]() { do_write(); }, mux_);
|
[this]() { do_write(); }, mux_);
|
||||||
if (handler_->start() != 0) {
|
if (handler_->start() != 0) {
|
||||||
stop();
|
stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user