Fix some flow control bugs. (#152)
* Release stream capacity back to the connection to avoid capacity leaks. * Actually notify waiting tasks when capacity becomes available.
This commit is contained in:
		| @@ -248,6 +248,8 @@ where | ||||
|     where | ||||
|         R: Resolve<B, P>, | ||||
|     { | ||||
|         trace!("assign_connection_capacity; inc={}", inc); | ||||
|  | ||||
|         self.flow.assign_capacity(inc); | ||||
|  | ||||
|         // Assign newly acquired capacity to streams pending capacity. | ||||
| @@ -315,6 +317,8 @@ where | ||||
|             // TODO: Should prioritization factor into this? | ||||
|             let assign = cmp::min(conn_available, additional); | ||||
|  | ||||
|             trace!("  assigning; num={}", assign); | ||||
|  | ||||
|             // Assign the capacity to the stream | ||||
|             stream.assign_capacity(assign); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user