From acb16f5574015520e6b73a631209eadc3a001841 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 25 Apr 2008 02:56:03 +0000 Subject: [PATCH] * Added missing select notifications on shutdown(). * Notify read/write instead of write/error when disconnecting. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25143 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/network/protocols/unix/UnixEndpoint.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.cpp b/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.cpp index 078fe8803a..ac5813132c 100644 --- a/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.cpp +++ b/src/add-ons/kernel/network/protocols/unix/UnixEndpoint.cpp @@ -685,6 +685,16 @@ UnixEndpoint::Shutdown(int direction) fPeerEndpoint->fReceiveFifo->Shutdown(peerShutdown); fPeerEndpoint->fReceiveFifo->Unlock(); + // send select notifications + if (direction == SHUT_RD || direction == SHUT_RDWR) { + gSocketModule->notify(socket, B_SELECT_READ, B_OK); + gSocketModule->notify(fPeerEndpoint->socket, B_SELECT_WRITE, B_OK); + } + if (direction == SHUT_WR || direction == SHUT_RDWR) { + gSocketModule->notify(socket, B_SELECT_WRITE, B_OK); + gSocketModule->notify(fPeerEndpoint->socket, B_SELECT_READ, B_OK); + } + RETURN_ERROR(B_OK); } @@ -717,8 +727,8 @@ UnixEndpoint::_Disconnect() fReceiveFifo->Unlock(); // select() notification. + gSocketModule->notify(socket, B_SELECT_READ, ECONNRESET); gSocketModule->notify(socket, B_SELECT_WRITE, ECONNRESET); - gSocketModule->notify(socket, B_SELECT_ERROR, ECONNRESET); // Unset the peer endpoint. fPeerEndpoint->RemoveReference();