From 3891e6d7397ed1cebca5e4675307874ef75286ce Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 8 Feb 2020 15:59:21 +0100 Subject: [PATCH] IPv4: Sockets should say can_read() after reading is shut down This allows clients to get their EOF after shutting down reading. --- Kernel/Net/IPv4Socket.cpp | 6 ++++++ Kernel/Net/IPv4Socket.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index 35c8c472b0..7d427941b6 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -505,3 +505,9 @@ void IPv4Socket::close() { shutdown(SHUT_RDWR); } + +void IPv4Socket::shut_down_for_reading() +{ + Socket::shut_down_for_reading(); + m_can_read = true; +} diff --git a/Kernel/Net/IPv4Socket.h b/Kernel/Net/IPv4Socket.h index ebf09c38ae..96650fdea2 100644 --- a/Kernel/Net/IPv4Socket.h +++ b/Kernel/Net/IPv4Socket.h @@ -100,6 +100,8 @@ protected: virtual int protocol_allocate_local_port() { return 0; } virtual bool protocol_is_disconnected() const { return false; } + virtual void shut_down_for_reading() override; + void set_local_address(IPv4Address address) { m_local_address = address; } void set_peer_address(IPv4Address address) { m_peer_address = address; }