MCPcopy
hub / github.com/grpc/grpc-go / updateFlowControl

Method updateFlowControl

internal/transport/http2_server.go:743–763  ·  view source on GitHub ↗

updateFlowControl updates the incoming flow control windows for the transport and the stream based on the current bdp estimation.

(n uint32)

Source from the content-addressed store, hash-verified

741// for the transport and the stream based on the current bdp
742// estimation.
743func (t *http2Server) updateFlowControl(n uint32) {
744 t.mu.Lock()
745 for _, s := range t.activeStreams {
746 s.fc.newLimit(n)
747 }
748 t.initialWindowSize = int32(n)
749 t.mu.Unlock()
750 t.controlBuf.put(&outgoingWindowUpdate{
751 streamID: 0,
752 increment: t.fc.newLimit(n),
753 })
754 t.controlBuf.put(&outgoingSettings{
755 ss: []http2.Setting{
756 {
757 ID: http2.SettingInitialWindowSize,
758 Val: n,
759 },
760 },
761 })
762
763}
764
765func (t *http2Server) handleData(f *parsedDataFrame) {
766 size := f.Header().Length

Callers 1

calculateMethod · 0.45

Calls 4

LockMethod · 0.45
newLimitMethod · 0.45
UnlockMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected