When sending a non heads-up goaway close the connection if there are no active streams. (#1474)
This commit is contained in:
@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user