mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:52:45 +00:00 
			
		
		
		
	Kernel: Block writes while we're establishing the TCP connection
Previously we would not block the caller until the connection was
established and would instead return EPIPE for the first send() call
which then likely caused the caller to abandon the socket.
This was broken by 0625342.
			
			
This commit is contained in:
		
							parent
							
								
									87b1da4441
								
							
						
					
					
						commit
						c3d702431a
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -584,6 +584,9 @@ bool TCPSocket::can_write(const FileDescription& file_description, size_t size) | ||||||
|     if (!IPv4Socket::can_write(file_description, size)) |     if (!IPv4Socket::can_write(file_description, size)) | ||||||
|         return false; |         return false; | ||||||
| 
 | 
 | ||||||
|  |     if (m_state == State::SynSent || m_state == State::SynReceived) | ||||||
|  |         return false; | ||||||
|  | 
 | ||||||
|     if (!file_description.is_blocking()) |     if (!file_description.is_blocking()) | ||||||
|         return true; |         return true; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gunnar Beutner
						Gunnar Beutner