File tree 1 file changed +9
-3
lines changed 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -1239,14 +1239,20 @@ void freeClientAsync(client *c) {
1239
1239
/* Free the clietns marked as CLOSE_ASAP, return the number of clients
1240
1240
* freed. */
1241
1241
int freeClientsInAsyncFreeQueue (void ) {
1242
- int freed = listLength (server .clients_to_close );
1243
- while (listLength (server .clients_to_close )) {
1244
- listNode * ln = listFirst (server .clients_to_close );
1242
+ int freed = 0 ;
1243
+ listIter li ;
1244
+ listNode * ln ;
1245
+
1246
+ listRewind (server .clients_to_close ,& li );
1247
+ while ((ln = listNext (& li )) != NULL ) {
1245
1248
client * c = listNodeValue (ln );
1246
1249
1250
+ if (c -> flags & CLIENT_PROTECTED ) continue ;
1251
+
1247
1252
c -> flags &= ~CLIENT_CLOSE_ASAP ;
1248
1253
freeClient (c );
1249
1254
listDelNode (server .clients_to_close ,ln );
1255
+ freed ++ ;
1250
1256
}
1251
1257
return freed ;
1252
1258
}
You can’t perform that action at this time.
0 commit comments