(f *WindowUpdateFrame)
| 3004 | } |
| 3005 | |
| 3006 | func (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 | |
| 3036 | func (rl *clientConnReadLoop) processResetStream(f *RSTStreamFrame) error { |
| 3037 | cs := rl.streamByID(f.StreamID) |
no test coverage detected