asio: Fix bug when end() is called outside nghttp2 callback

This commit is contained in:
Tatsuhiro Tsujikawa 2016-10-19 23:17:43 +09:00
parent 19f1785cde
commit 08a9a2eca9
1 changed files with 2 additions and 1 deletions

View File

@ -404,7 +404,8 @@ void http2_handler::stream_error(int32_t stream_id, uint32_t error_code) {
void http2_handler::signal_write() { void http2_handler::signal_write() {
if (!inside_callback_) { if (!inside_callback_) {
initiate_write(); auto self = shared_from_this();
io_service_.post([self]() { self->initiate_write(); });
} }
} }