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

Kernel: Make sockets use AK::Time

This commit is contained in:
Ben Wiederhake 2021-02-28 02:48:45 +01:00 committed by Andreas Kling
parent 719cb93a1a
commit 5c15ca7b84
13 changed files with 54 additions and 53 deletions

View file

@ -285,8 +285,7 @@ auto Thread::WriteBlocker::override_timeout(const BlockTimeout& timeout) -> cons
if (description.is_socket()) {
auto& socket = *description.socket();
if (socket.has_send_timeout()) {
// FIXME: Should use AK::Time internally
Time send_timeout = Time::from_timeval(socket.send_timeout());
Time send_timeout = socket.send_timeout();
m_timeout = BlockTimeout(false, &send_timeout, timeout.start_time(), timeout.clock_id());
if (timeout.is_infinite() || (!m_timeout.is_infinite() && m_timeout.absolute_time() < timeout.absolute_time()))
return m_timeout;
@ -306,8 +305,7 @@ auto Thread::ReadBlocker::override_timeout(const BlockTimeout& timeout) -> const
if (description.is_socket()) {
auto& socket = *description.socket();
if (socket.has_receive_timeout()) {
// FIXME: Should use AK::Time internally
Time receive_timeout = Time::from_timeval(socket.receive_timeout());
Time receive_timeout = socket.receive_timeout();
m_timeout = BlockTimeout(false, &receive_timeout, timeout.start_time(), timeout.clock_id());
if (timeout.is_infinite() || (!m_timeout.is_infinite() && m_timeout.absolute_time() < timeout.absolute_time()))
return m_timeout;