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

Function takeInflows

internal/http2/flow.go:68–75  ·  view source on GitHub ↗

takeInflows attempts to take n bytes from two inflows, typically connection-level and stream-level flows. It reports whether both windows have available capacity.

(f1, f2 *inflow, n uint32)

Source from the content-addressed store, hash-verified

66// typically connection-level and stream-level flows.
67// It reports whether both windows have available capacity.
68func takeInflows(f1, f2 *inflow, n uint32) bool {
69 if n > uint32(f1.avail) || n > uint32(f2.avail) {
70 return false
71 }
72 f1.avail -= int32(n)
73 f2.avail -= int32(n)
74 return true
75}
76
77// outflow is the outbound flow control window's size.
78type outflow struct {

Callers 2

processDataMethod · 0.85
TestTakeInflowsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTakeInflowsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…