deleteStream deletes the stream s from transport's active streams.
(s *ServerStream, eosReceived bool)
| 1305 | |
| 1306 | // deleteStream deletes the stream s from transport's active streams. |
| 1307 | func (t *http2Server) deleteStream(s *ServerStream, eosReceived bool) { |
| 1308 | t.mu.Lock() |
| 1309 | _, isActive := t.activeStreams[s.id] |
| 1310 | if isActive { |
| 1311 | delete(t.activeStreams, s.id) |
| 1312 | if len(t.activeStreams) == 0 { |
| 1313 | t.idle = time.Now() |
| 1314 | } |
| 1315 | } |
| 1316 | t.mu.Unlock() |
| 1317 | |
| 1318 | if isActive && channelz.IsOn() { |
| 1319 | if eosReceived { |
| 1320 | t.channelz.SocketMetrics.StreamsSucceeded.Add(1) |
| 1321 | } else { |
| 1322 | t.channelz.SocketMetrics.StreamsFailed.Add(1) |
| 1323 | } |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | // finishStream closes the stream and puts the trailing headerFrame into controlbuf. |
| 1328 | func (t *http2Server) finishStream(s *ServerStream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) { |