delaying client disconnect using freeClientAsync()
- when a client is marked for closing (i.e. after protocol error) we are delaying it slightly by using freeClientAsync() instead of freeClient() as sometimes the latter was closing connection too fast without reply being actually sent
This commit is contained in:
@@ -654,7 +654,13 @@ static void acceptCommonHandler(int fd, int flags, char *ip) {
|
||||
/* Nothing to do, Just to avoid the warning... */
|
||||
}
|
||||
server.stat_rejected_conn++;
|
||||
#ifdef _WIN32
|
||||
//[tporadowski] freeClient was sometimes causing sent reply to be not delivered, so give it some
|
||||
// additional time via freeing asynchronously
|
||||
freeClientAsync(c);
|
||||
#else
|
||||
freeClient(c);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1065,7 +1071,13 @@ int writeToClient(int fd, client *c, int handler_installed) {
|
||||
|
||||
/* Close connection after entire reply has been sent. */
|
||||
if (c->flags & CLIENT_CLOSE_AFTER_REPLY) {
|
||||
#ifdef _WIN32
|
||||
//[tporadowski] freeClient was sometimes causing sent reply to be not delivered, so give it some
|
||||
// additional time via freeing asynchronously
|
||||
freeClientAsync(c);
|
||||
#else
|
||||
freeClient(c);
|
||||
#endif
|
||||
return C_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user