Add test that would make wait_for_capacity hang if it doesn't loop
This commit is contained in:
		
				
					committed by
					
						 Sean McArthur
						Sean McArthur
					
				
			
			
				
	
			
			
			
						parent
						
							87969c1f29
						
					
				
				
					commit
					e9e0f27b80
				
			| @@ -54,14 +54,14 @@ impl Future for WaitForCapacity { | ||||
|     type Output = h2::SendStream<Bytes>; | ||||
|  | ||||
|     fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { | ||||
|         let _ = ready!(self.stream().poll_capacity(cx)).unwrap(); | ||||
|         loop { | ||||
|             let _ = ready!(self.stream().poll_capacity(cx)).unwrap(); | ||||
|  | ||||
|         let act = self.stream().capacity(); | ||||
|             let act = self.stream().capacity(); | ||||
|  | ||||
|         if act >= self.target { | ||||
|             return Poll::Ready(self.stream.take().unwrap().into()); | ||||
|             if act >= self.target { | ||||
|                 return Poll::Ready(self.stream.take().unwrap().into()); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         Poll::Pending | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user