Skip to content

Commit 51eea1e

Browse files
committed
Update reset max_fd
1 parent 001e6f7 commit 51eea1e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/network/Connection.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,15 @@ SWINLINE int swServer_new_connection(swServer *serv, swEvent *ev)
144144
if(conn_fd > swServer_get_maxfd(serv))
145145
{
146146
swServer_set_maxfd(serv, conn_fd);
147+
148+
/**
149+
* Correction of the number of connections
150+
*/
151+
if (serv->connect_count > conn_fd)
152+
{
153+
serv->connect_count = conn_fd;
154+
}
155+
147156
#ifdef SW_CONNECTION_LIST_EXPAND
148157
//新的fd超过了最大fd
149158

0 commit comments

Comments
 (0)