diff options
author | dnobori <da.git@softether.co.jp> | 2021-06-07 16:18:30 +0300 |
---|---|---|
committer | dnobori <da.git@softether.co.jp> | 2021-06-07 16:18:30 +0300 |
commit | ddc99f085fd6c54feaf4e41912bc8ab5903bdf8e (patch) | |
tree | 7c60824b852a62ea79e528b4607f47a0ecf55009 /src/Cedar/Connection.c | |
parent | ec3d052e218281dc1aa734f1bf84cf42127744aa (diff) |
v4.36-9754-betav4.36-9754-beta
Diffstat (limited to 'src/Cedar/Connection.c')
-rw-r--r-- | src/Cedar/Connection.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Cedar/Connection.c b/src/Cedar/Connection.c index 5bdb0a34..e7298ddd 100644 --- a/src/Cedar/Connection.c +++ b/src/Cedar/Connection.c @@ -1709,7 +1709,7 @@ void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2) num = LIST_NUM(tcp->TcpSockList);
if (num >= s->MaxConnection)
{
- TCPSOCK *ts;
+ TCPSOCK *ts = NULL;
for (i = 0;i < num;i++)
{
ts = LIST_DATA(tcp->TcpSockList, i);
@@ -1722,11 +1722,14 @@ void ConnectionReceive(CONNECTION *c, CANCEL *c1, CANCEL *c2) c2s++;
}
}
- if (s2c == 0 || c2s == 0)
+ if (ts != NULL)
{
- // Disconnect the last socket
- Disconnect(ts->Sock);
- Debug("Disconnect (s2c=%u, c2s=%u)\n", s2c, c2s);
+ if (s2c == 0 || c2s == 0)
+ {
+ // Disconnect the last socket
+ Disconnect(ts->Sock);
+ Debug("Disconnect (s2c=%u, c2s=%u)\n", s2c, c2s);
+ }
}
}
}
|