Add GOAWAY handling on asio client

This commit is contained in:
hap2712 2020-03-31 09:37:49 +02:00
parent b3f85e2daa
commit 689e63e9ce
1 changed files with 9 additions and 0 deletions

View File

@ -329,6 +329,15 @@ int on_frame_recv_callback(nghttp2_session *session, const nghttp2_frame *frame,
break; break;
} }
case NGHTTP2_GOAWAY: {
if (!sess->stopped()) {
auto& cb = sess->on_error();
auto ec = make_error_code(
static_cast<nghttp2_error>(NGHTTP2_ERR_START_STREAM_NOT_ALLOWED));
cb(ec);
}
break;
}
} }
return 0; return 0;
} }