diff options
author | Andreas Kling <kling@serenityos.org> | 2020-01-26 17:54:23 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-01-26 17:54:23 +0100 |
commit | 137a45dff2a6c60dbca34ee6b1e27ff476fe9b40 (patch) | |
tree | 49e38ba4b9d8938a34ef7a38bd0e856077bcd5f8 /Kernel/Net/IPv4Socket.cpp | |
parent | d1721c761e3dce78ceb27aaaba2ad7836e669306 (diff) | |
download | serenity-137a45dff2a6c60dbca34ee6b1e27ff476fe9b40.zip |
Kernel: read()/write() should respect timeouts when used on a sockets
Move timeout management to the ReadBlocker and WriteBlocker classes.
Also get rid of the specialized ReceiveBlocker since it no longer does
anything that ReadBlocker can't do.
Diffstat (limited to 'Kernel/Net/IPv4Socket.cpp')
-rw-r--r-- | Kernel/Net/IPv4Socket.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index b6f78d7c18..368557bb28 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -264,8 +264,7 @@ ssize_t IPv4Socket::recvfrom(FileDescription& description, void* buffer, size_t return -EAGAIN; } - load_receive_deadline(); - auto res = current->block<Thread::ReceiveBlocker>(description); + auto res = current->block<Thread::ReadBlocker>(description); LOCKER(lock()); if (!m_can_read) { @@ -312,8 +311,7 @@ ssize_t IPv4Socket::recvfrom(FileDescription& description, void* buffer, size_t return 0; } - load_receive_deadline(); - auto res = current->block<Thread::ReceiveBlocker>(description); + auto res = current->block<Thread::ReadBlocker>(description); LOCKER(lock()); if (!m_can_read) { |