From fe752174a9dbfe2fc5361d6adb38e786678f1b0c Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 18 May 2015 21:38:12 +0900 Subject: [PATCH] nghttpd: Close connection after settings timeout and GOAWAY was sent --- src/HttpServer.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 0465395d..800b5f97 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -326,9 +326,13 @@ void on_session_closed(Http2Handler *hd, int64_t session_id) { namespace { void settings_timeout_cb(struct ev_loop *loop, ev_timer *w, int revents) { + int rv; auto hd = static_cast(w->data); hd->terminate_session(NGHTTP2_SETTINGS_TIMEOUT); - hd->on_write(); + rv = hd->on_write(); + if (rv == -1) { + delete_handler(hd); + } } } // namespace