Skip to content

Commit

Permalink
don't try to send to reqHeaderMu when waiting for extended connect
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Nov 22, 2024
1 parent 4aac677 commit 23eded4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions http2/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,6 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre
}
if isExtendedConnect {
select {
case cc.reqHeaderMu <- struct{}{}:
case <-cs.reqCancel:
return errRequestCanceled
case <-ctx.Done():
Expand All @@ -1421,14 +1420,13 @@ func (cs *clientStream) writeRequest(req *http.Request, streamf func(*clientStre
return errExtendedConnectNotSupported
}
}
} else {
select {
case cc.reqHeaderMu <- struct{}{}:
case <-cs.reqCancel:
return errRequestCanceled
case <-ctx.Done():
return ctx.Err()
}
}
select {
case cc.reqHeaderMu <- struct{}{}:
case <-cs.reqCancel:
return errRequestCanceled
case <-ctx.Done():
return ctx.Err()
}

cc.mu.Lock()
Expand Down

0 comments on commit 23eded4

Please sign in to comment.