From 39596153a9a468cec5f9bc0085c9548fc02eb2b2 Mon Sep 17 00:00:00 2001 From: mmukhi Date: Fri, 25 Aug 2017 14:57:41 -0700 Subject: [PATCH] When sending a non heads-up goaway close the connection if there are no active streams. (#1474) --- transport/http2_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transport/http2_server.go b/transport/http2_server.go index eeeacf77..0fd81af9 100644 --- a/transport/http2_server.go +++ b/transport/http2_server.go @@ -1089,9 +1089,10 @@ func (t *http2Server) controller() { if !i.headsUp { // Stop accepting more streams now. t.state = draining + activeStreams := len(t.activeStreams) t.mu.Unlock() t.framer.writeGoAway(true, sid, i.code, i.debugData) - if i.closeConn { + if i.closeConn || activeStreams == 0 { // Abruptly close the connection following the GoAway. t.Close() }