Fix some flow control bugs
When a stream is closed, connection level capacity should be released back to the connection and then assigned to other streams waiting for capacity.
This commit is contained in:
		| @@ -86,8 +86,11 @@ where B: Buf, | ||||
|         -> Result<(), UserError> | ||||
|     { | ||||
|         trace!("send_headers; frame={:?}; init_window={:?}", frame, self.init_window_sz); | ||||
|  | ||||
|         let end_stream = frame.is_end_stream(); | ||||
|  | ||||
|         // Update the state | ||||
|         stream.state.send_open(frame.is_end_stream())?; | ||||
|         stream.state.send_open(end_stream)?; | ||||
|  | ||||
|         // Queue the frame for sending | ||||
|         self.prioritize.queue_frame(frame.into(), stream, task); | ||||
| @@ -156,6 +159,9 @@ where B: Buf, | ||||
|         trace!("send_trailers -- queuing; frame={:?}", frame); | ||||
|         self.prioritize.queue_frame(frame.into(), stream, task); | ||||
|  | ||||
|         // Release any excess capacity | ||||
|         self.prioritize.reserve_capacity(0, stream); | ||||
|  | ||||
|         Ok(()) | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user