MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / revokeClientAuthentication

Function revokeClientAuthentication

src/module.cpp:6628–6645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6626}
6627
6628void revokeClientAuthentication(client *c) {
6629 /* Freeing the client would result in moduleNotifyUserChanged() to be
6630 * called later, however since we use revokeClientAuthentication() also
6631 * in moduleFreeAuthenticatedClients() to implement module unloading, we
6632 * do this action ASAP: this way if the module is unloaded, when the client
6633 * is eventually freed we don't rely on the module to still exist. */
6634 moduleNotifyUserChanged(c);
6635
6636 c->user = DefaultUser;
6637 c->authenticated = 0;
6638 /* We will write replies to this client later, so we can't close it
6639 * directly even if async. */
6640 if (c == serverTL->current_client) {
6641 c->flags |= CLIENT_CLOSE_AFTER_COMMAND;
6642 } else {
6643 freeClientAsync(c);
6644 }
6645}
6646
6647/* Cleanup all clients that have been authenticated with this module. This
6648 * 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