updateFlowControl updates the incoming flow control windows for the transport and the stream based on the current bdp estimation.
(n uint32)
| 741 | // for the transport and the stream based on the current bdp |
| 742 | // estimation. |
| 743 | func (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 | |
| 765 | func (t *http2Server) handleData(f *parsedDataFrame) { |
| 766 | size := f.Header().Length |