Address feedback on ControlFlow and FlowControl
ControlFlow::poll_window_update now exposes, effectively, a Stream of WindowUpdates. Callers no longer poll on invidual stream IDs. To accomplish this, FlowControl maintains a queue of pending remote stream ids. Improve/shorten naming throughout FlowControl. FlowControlState::check_window has been added so that FlowControl is now consistent in the face of stream-level flow control errors. Connection now exposes the ControlFlow functions without exposing the ControlFlow interface publicly.
This commit is contained in:
		| @@ -90,7 +90,8 @@ impl StreamState { | ||||
|                 if eos { | ||||
|                     *self = HalfClosedRemote(local); | ||||
|                 } else { | ||||
|                     *self = Open { local, remote: Data(FlowControlState::with_initial_size(initial_recv_window_size)) }; | ||||
|                     let remote = Data(FlowControlState::with_initial_size(initial_recv_window_size)); | ||||
|                     *self = Open { local, remote }; | ||||
|                 } | ||||
|                 Ok(true) | ||||
|             } | ||||
| @@ -300,6 +301,14 @@ impl StreamMap { | ||||
|         self.inner.get_mut(&id) | ||||
|     } | ||||
|  | ||||
|     pub fn local_flow_controller(&mut self, id: StreamId) -> Option<&mut FlowControlState> { | ||||
|         self.inner.get_mut(&id).and_then(|s| s.local_flow_controller()) | ||||
|     } | ||||
|  | ||||
|     pub fn remote_flow_controller(&mut self, id: StreamId) -> Option<&mut FlowControlState> { | ||||
|         self.inner.get_mut(&id).and_then(|s| s.remote_flow_controller()) | ||||
|     } | ||||
|  | ||||
|     pub fn has_stream(&mut self, id: StreamId) -> bool { | ||||
|         self.inner.contains_key(&id) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user