| 6434 | } |
| 6435 | |
| 6436 | void revokeClientAuthentication(client *c) { |
| 6437 | /* Freeing the client would result in moduleNotifyUserChanged() to be |
| 6438 | * called later, however since we use revokeClientAuthentication() also |
| 6439 | * in moduleFreeAuthenticatedClients() to implement module unloading, we |
| 6440 | * do this action ASAP: this way if the module is unloaded, when the client |
| 6441 | * is eventually freed we don't rely on the module to still exist. */ |
| 6442 | moduleNotifyUserChanged(c); |
| 6443 | |
| 6444 | c->user = DefaultUser; |
| 6445 | c->authenticated = 0; |
| 6446 | /* We will write replies to this client later, so we can't close it |
| 6447 | * directly even if async. */ |
| 6448 | if (c == server.current_client) { |
| 6449 | c->flags |= CLIENT_CLOSE_AFTER_COMMAND; |
| 6450 | } else { |
| 6451 | freeClientAsync(c); |
| 6452 | } |
| 6453 | } |
| 6454 | |
| 6455 | /* Cleanup all clients that have been authenticated with this module. This |
| 6456 | * is called from onUnload() to give the module a chance to cleanup any |
no test coverage detected