MCPcopy Create free account
hub / github.com/imroc/req / processWindowUpdate

Method processWindowUpdate

internal/http2/transport.go:3006–3034  ·  view source on GitHub ↗
(f *WindowUpdateFrame)

Source from the content-addressed store, hash-verified

3004}
3005
3006func (rl *clientConnReadLoop) processWindowUpdate(f *WindowUpdateFrame) error {
3007 cc := rl.cc
3008 cs := rl.streamByID(f.StreamID)
3009 if f.StreamID != 0 && cs == nil {
3010 return nil
3011 }
3012
3013 cc.mu.Lock()
3014 defer cc.mu.Unlock()
3015
3016 fl := &cc.flow
3017 if cs != nil {
3018 fl = &cs.flow
3019 }
3020 if !fl.add(int32(f.Increment)) {
3021 // For stream, the sender sends RST_STREAM with an error code of FLOW_CONTROL_ERROR
3022 if cs != nil {
3023 rl.endStreamError(cs, StreamError{
3024 StreamID: f.StreamID,
3025 Code: ErrCodeFlowControl,
3026 })
3027 return nil
3028 }
3029
3030 return ConnectionError(ErrCodeFlowControl)
3031 }
3032 cc.cond.Broadcast()
3033 return nil
3034}
3035
3036func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error {
3037 cs := rl.streamByID(f.StreamID)

Callers 1

runMethod · 0.95

Calls 6

streamByIDMethod · 0.95
endStreamErrorMethod · 0.95
ConnectionErrorTypeAlias · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected