MCPcopy Create free account
hub / github.com/F-Stack/f-stack / revokeClientAuthentication

Function revokeClientAuthentication

app/redis-6.2.6/src/module.c:6436–6453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6434}
6435
6436void 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

Callers 2

Calls 2

moduleNotifyUserChangedFunction · 0.85
freeClientAsyncFunction · 0.85

Tested by

no test coverage detected