1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

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.
This commit is contained in:
Andreas Kling 2020-01-26 17:54:23 +01:00
parent d1721c761e
commit 137a45dff2
7 changed files with 48 additions and 57 deletions

View file

@ -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) {