This function is called when a client's user has changed and invokes the * client's user changed callback if it was set. This callback should * cleanup any state the module was tracking about this client. * * A client's user can be changed through the AUTH command, module * authentication, and when a client is freed. */
| 6421 | * A client's user can be changed through the AUTH command, module |
| 6422 | * authentication, and when a client is freed. */ |
| 6423 | void moduleNotifyUserChanged(client *c) { |
| 6424 | if (c->auth_callback) { |
| 6425 | c->auth_callback(c->id, c->auth_callback_privdata); |
| 6426 | |
| 6427 | /* The callback will fire exactly once, even if the user remains |
| 6428 | * the same. It is expected to completely clean up the state |
| 6429 | * so all references are cleared here. */ |
| 6430 | c->auth_callback = NULL; |
| 6431 | c->auth_callback_privdata = NULL; |
| 6432 | c->auth_module = NULL; |
| 6433 | } |
| 6434 | } |
| 6435 | |
| 6436 | void revokeClientAuthentication(client *c) { |
| 6437 | /* Freeing the client would result in moduleNotifyUserChanged() to be |
no outgoing calls
no test coverage detected