Fix tight loop on aborted connection (#285)
When the underlying IO returns 0 on read, we must stop polling it since it's closed. Otherwise we'll be stuck in a tight loop. this fixes https://github.com/sfackler/rust-openssl/issues/949
This commit is contained in:
		
				
					committed by
					
						 Carl Lerche
						Carl Lerche
					
				
			
			
				
	
			
			
			
						parent
						
							2b59803866
						
					
				
				
					commit
					74a5e072fe
				
			| @@ -589,3 +589,19 @@ fn poll_reset_after_send_response_is_user_error() { | ||||
|  | ||||
|     srv.join(client).wait().expect("wait"); | ||||
| } | ||||
|  | ||||
| #[test] | ||||
| fn server_error_on_unclean_shutdown() { | ||||
|     use std::io::Write; | ||||
|  | ||||
|     let _ = ::env_logger::try_init(); | ||||
|     let (io, mut client) = mock::new(); | ||||
|  | ||||
|     let srv = server::Builder::new() | ||||
|         .handshake::<_, Bytes>(io); | ||||
|  | ||||
|     client.write_all(b"PRI *").expect("write"); | ||||
|     drop(client); | ||||
|  | ||||
|     srv.wait().expect_err("should error"); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user