future-proofing
This commit is contained in:
@ -495,7 +495,9 @@ func (t *http2Client) CloseStream(s *Stream, err error) {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if !rstStream {
|
if !rstStream {
|
||||||
t.streamsQuota.add(1)
|
t.streamsQuota.add(1)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
t.controlBuf.put(&resetStream{s.id, http2.ErrCodeCancel})
|
||||||
}()
|
}()
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
rstStream = s.rstStream
|
rstStream = s.rstStream
|
||||||
@ -516,7 +518,6 @@ func (t *http2Client) CloseStream(s *Stream, err error) {
|
|||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
if se, ok := err.(StreamError); ok && se.Code != codes.DeadlineExceeded {
|
if se, ok := err.(StreamError); ok && se.Code != codes.DeadlineExceeded {
|
||||||
rstStream = true
|
rstStream = true
|
||||||
t.controlBuf.put(&resetStream{s.id, http2.ErrCodeCancel})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,7 +762,6 @@ func (t *http2Client) handleData(f *http2.DataFrame) {
|
|||||||
close(s.done)
|
close(s.done)
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
s.write(recvMsg{err: io.EOF})
|
s.write(recvMsg{err: io.EOF})
|
||||||
t.controlBuf.put(&resetStream{s.id, http2.ErrCodeFlowControl})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
|
Reference in New Issue
Block a user