stats: Fix bug causing trailers-only responses to be reported as headers (#1817)
This commit is contained in:
@ -1118,8 +1118,9 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
|
|||||||
|
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
if !s.headerDone {
|
if !s.headerDone {
|
||||||
// Headers frame is not actually a trailers-only frame.
|
|
||||||
if !endStream {
|
if !endStream {
|
||||||
|
// Headers frame is not actually a trailers-only frame.
|
||||||
|
isHeader = true
|
||||||
s.recvCompress = state.encoding
|
s.recvCompress = state.encoding
|
||||||
if len(state.mdata) > 0 {
|
if len(state.mdata) > 0 {
|
||||||
s.header = state.mdata
|
s.header = state.mdata
|
||||||
@ -1127,7 +1128,6 @@ func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) {
|
|||||||
}
|
}
|
||||||
close(s.headerChan)
|
close(s.headerChan)
|
||||||
s.headerDone = true
|
s.headerDone = true
|
||||||
isHeader = true
|
|
||||||
}
|
}
|
||||||
if !endStream || s.state == streamDone {
|
if !endStream || s.state == streamDone {
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
|
Reference in New Issue
Block a user