git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tools/DiskTool - Added script file support
[tpg/acess2.git]
/
KernelLand
/
Modules
/
IPStack
/
tcp.c
diff --git
a/KernelLand/Modules/IPStack/tcp.c
b/KernelLand/Modules/IPStack/tcp.c
index
8d954bc
..
c10213c
100644
(file)
--- a/
KernelLand/Modules/IPStack/tcp.c
+++ b/
KernelLand/Modules/IPStack/tcp.c
@@
-1084,6
+1084,7
@@
tVFS_Node *TCP_Client_Init(tInterface *Interface)
conn->LocalPort = -1;
conn->RemotePort = -1;
conn->LocalPort = -1;
conn->RemotePort = -1;
+ conn->Node.ReferenceCount = 1;
conn->Node.ImplPtr = conn;
conn->Node.NumACLs = 1;
conn->Node.ACLs = &gVFS_ACL_EveryoneRW;
conn->Node.ImplPtr = conn;
conn->Node.NumACLs = 1;
conn->Node.ACLs = &gVFS_ACL_EveryoneRW;
@@
-1367,6
+1368,15
@@
void TCP_Client_Close(tVFS_Node *Node)
ENTER("pNode", Node);
ENTER("pNode", Node);
+ ASSERT(Node->ReferenceCount != 0);
+
+ if( Node->ReferenceCount > 1 ) {
+ Node->ReferenceCount --;
+ LOG("Dereference only");
+ LEAVE('-');
+ return ;
+ }
+
if( conn->State == TCP_ST_CLOSE_WAIT || conn->State == TCP_ST_OPEN )
{
packet.SourcePort = htons(conn->LocalPort);
if( conn->State == TCP_ST_CLOSE_WAIT || conn->State == TCP_ST_OPEN )
{
packet.SourcePort = htons(conn->LocalPort);
@@
-1383,6
+1393,9
@@
void TCP_Client_Close(tVFS_Node *Node)
switch( conn->State )
{
switch( conn->State )
{
+ case TCP_ST_CLOSED:
+ Log_Warning("TCP", "Closing connection that was never opened");
+ break;
case TCP_ST_CLOSE_WAIT:
conn->State = TCP_ST_LAST_ACK;
break;
case TCP_ST_CLOSE_WAIT:
conn->State = TCP_ST_LAST_ACK;
break;
UCC
git Repository :: git.ucc.asn.au