mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:52:43 +00:00 
			
		
		
		
	LibHTTP: Take the final EOF read notification into account
Fixes the HTTP part of #3691.
This commit is contained in:
		
							parent
							
								
									80cffdc0a1
								
							
						
					
					
						commit
						ddc255a6c0
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -125,6 +125,17 @@ void Job::on_socket_connected() | |||
|     register_on_ready_to_read([&] { | ||||
|         if (is_cancelled()) | ||||
|             return; | ||||
| 
 | ||||
|         if (m_state == State::Finished) { | ||||
|             // This is probably just a EOF notification, which means we should receive nothing
 | ||||
|             // and then get eof() == true.
 | ||||
|             [[maybe_unused]] auto payload = receive(64); | ||||
|             // These assertions are only correct if "Connection: close".
 | ||||
|             ASSERT(payload.is_empty()); | ||||
|             ASSERT(eof()); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         if (m_state == State::InStatus) { | ||||
|             if (!can_read_line()) | ||||
|                 return; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AnotherTest
						AnotherTest