mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-02 16:33:13 +00:00
Kernel: Clear SO_ERROR on successful socket connection
When TCP sockets successfully establish a connection, any SO_ERROR should be cleared back to success. For example, SO_ERROR gets set to EINPROGRESS on asynchronous connect calls and should be cleared when the socket moves to the Established state.
This commit is contained in:
parent
8059f28977
commit
6743170f4e
Notes:
sideshowbarker
2024-07-18 07:01:42 +09:00
Author: https://github.com/brapru
Commit: 6743170f4e
Pull-request: https://github.com/SerenityOS/serenity/pull/9354
Issue: https://github.com/SerenityOS/serenity/issues/7966
Reviewed-by: https://github.com/alimpfard ✅
1 changed files with 3 additions and 1 deletions
|
@ -38,8 +38,10 @@ void TCPSocket::set_state(State new_state)
|
|||
|
||||
m_state = new_state;
|
||||
|
||||
if (new_state == State::Established && m_direction == Direction::Outgoing)
|
||||
if (new_state == State::Established && m_direction == Direction::Outgoing) {
|
||||
m_role = Role::Connected;
|
||||
[[maybe_unused]] auto rc = set_so_error(KSuccess);
|
||||
}
|
||||
|
||||
if (new_state == State::Closed) {
|
||||
closing_sockets().with_exclusive([&](auto& table) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue