Commit 2d6211c4 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

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.
parent e302cc9c
...@@ -79,8 +79,10 @@ public: ...@@ -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();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment