diff --git a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp index 3dbde59b7c..6c2dd53740 100644 --- a/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp +++ b/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp @@ -55,7 +55,7 @@ #define PrintAddress(address) \ AddressString(Domain(), address, true).Data() -#define TRACE_TCP +//#define TRACE_TCP //#define PROBE_TCP #ifdef TRACE_TCP @@ -1621,6 +1621,12 @@ TCPEndpoint::SegmentReceived(tcp_segment_header& segment, net_buffer* buffer) else if (segmentAction & ACKNOWLEDGE) DelayedAcknowledge(); + if (fState == CLOSED && (fFlags & FLAG_CLOSED) != 0) { + locker.Unlock(); + gSocketModule->delete_socket(socket); + // this will also delete us + } + return segmentAction; }