* Fixed read() on a read-shutdown socket. It must never wait.

* Added TODO regarding read/write shutdown.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25515 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-15 21:05:59 +00:00
parent 8a1852a447
commit 5947a3be5a

View File

@ -702,8 +702,11 @@ TCPEndpoint::Shutdown(int direction)
if (direction == SHUT_RD || direction == SHUT_RDWR)
fFlags |= FLAG_NO_RECEIVE;
if (direction == SHUT_WR || direction == SHUT_RDWR)
if (direction == SHUT_WR || direction == SHUT_RDWR) {
// TODO: That's not correct. After read/write shutting down the socket
// one should still be able to read previously arrived data.
_Disconnect(false);
}
return B_OK;
}
@ -883,6 +886,9 @@ TCPEndpoint::ReadData(size_t numBytes, uint32 flags, net_buffer** _buffer)
if ((flags & MSG_DONTWAIT) != 0 || socket->receive.timeout == 0)
return B_WOULD_BLOCK;
if ((fFlags & FLAG_NO_RECEIVE) != 0)
return B_OK;
status_t status = fReceiveList.Wait(locker, timeout);
if (status < B_OK) {
// The Open Group base specification mentions that EINTR should be