1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:15:07 +00:00

Kernel: Detect some outgoing TCP connection failures

This commit is contained in:
Conrad Pankoff 2019-08-10 13:18:18 +10:00 committed by Andreas Kling
parent bd6d2c0819
commit fc3667c026
3 changed files with 46 additions and 1 deletions

View file

@ -274,6 +274,8 @@ KResult TCPSocket::protocol_connect(FileDescription& description, ShouldBlock sh
if (current->block<Thread::ConnectBlocker>(description) == Thread::BlockResult::InterruptedBySignal)
return KResult(-EINTR);
ASSERT(setup_state() == SetupState::Completed);
if (has_error())
return KResult(-ECONNREFUSED);
return KSuccess;
}