* For local connections, we no longer use the TIME_WAIT state; in this case,
we know that the connection was torn down cleanly, and there are no inflight segments floating around anymore. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25239 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cd2bea0cd2
commit
ae33c41ea8
@ -217,7 +217,8 @@ enum {
|
||||
// That is, what is expected from accept() after a shutdown()
|
||||
// is performed on a listen()ing socket.
|
||||
FLAG_NO_RECEIVE = 0x04,
|
||||
FLAG_CLOSED = 0x08
|
||||
FLAG_CLOSED = 0x08,
|
||||
FLAG_DELETE = 0x10,
|
||||
};
|
||||
|
||||
|
||||
@ -970,13 +971,14 @@ TCPEndpoint::_EnterTimeWait()
|
||||
{
|
||||
TRACE("_EnterTimeWait()\n");
|
||||
|
||||
_CancelConnectionTimers();
|
||||
#if 0
|
||||
if (fState == TIME_WAIT && fRoute != NULL
|
||||
&& (fRoute->flags & RTF_LOCAL) != 0)
|
||||
&& (fRoute->flags & RTF_LOCAL) != 0) {
|
||||
// we do not use TIME_WAIT state for local connections
|
||||
fFlags |= FLAG_DELETE;
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
_CancelConnectionTimers();
|
||||
_UpdateTimeWait();
|
||||
}
|
||||
|
||||
@ -1621,7 +1623,8 @@ TCPEndpoint::SegmentReceived(tcp_segment_header& segment, net_buffer* buffer)
|
||||
else if (segmentAction & ACKNOWLEDGE)
|
||||
DelayedAcknowledge();
|
||||
|
||||
if (fState == CLOSED && (fFlags & FLAG_CLOSED) != 0) {
|
||||
if ((fState == CLOSED && (fFlags & FLAG_CLOSED) != 0)
|
||||
|| (fFlags & FLAG_DELETE) != 0) {
|
||||
locker.Unlock();
|
||||
gSocketModule->delete_socket(socket);
|
||||
// this will also delete us
|
||||
|
Loading…
Reference in New Issue
Block a user