Prevent pushing a stream into both pending_send + pending_open (#235)
Prevent pushing a stream into both pending_send + pending_open, Clear out variables from buffered streams that get a reset, and ignore them when traversing the pending_send queue if they are is_reset(). Add asserts that a stream cannot be in pending_open & pending_send at the same time.
This commit is contained in:
		
				
					committed by
					
						 Carl Lerche
						Carl Lerche
					
				
			
			
				
	
			
			
			
						parent
						
							200c04f1d3
						
					
				
				
					commit
					bbed41974b
				
			| @@ -336,6 +336,11 @@ impl store::Next for NextSend { | ||||
|     } | ||||
|  | ||||
|     fn set_queued(stream: &mut Stream, val: bool) { | ||||
|         if val { | ||||
|             // ensure that stream is not queued for being opened | ||||
|             // if it's being put into queue for sending data | ||||
|             debug_assert_eq!(stream.is_pending_open, false); | ||||
|         } | ||||
|         stream.is_pending_send = val; | ||||
|     } | ||||
| } | ||||
| @@ -402,6 +407,11 @@ impl store::Next for NextOpen { | ||||
|     } | ||||
|  | ||||
|     fn set_queued(stream: &mut Stream, val: bool) { | ||||
|         if val { | ||||
|             // ensure that stream is not queued for being sent | ||||
|             // if it's being put into queue for opening the stream | ||||
|             debug_assert_eq!(stream.is_pending_send, false); | ||||
|         } | ||||
|         stream.is_pending_open = val; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user