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. */
| 6613 | * A client's user can be changed through the AUTH command, module |
| 6614 | * authentication, and when a client is freed. */ |
| 6615 | void moduleNotifyUserChanged(client *c) { |
| 6616 | if (c->auth_callback) { |
| 6617 | c->auth_callback(c->id, c->auth_callback_privdata); |
| 6618 | |
| 6619 | /* The callback will fire exactly once, even if the user remains |
| 6620 | * the same. It is expected to completely clean up the state |
| 6621 | * so all references are cleared here. */ |
| 6622 | c->auth_callback = NULL; |
| 6623 | c->auth_callback_privdata = NULL; |
| 6624 | c->auth_module = NULL; |
| 6625 | } |
| 6626 | } |
| 6627 | |
| 6628 | void revokeClientAuthentication(client *c) { |
| 6629 | /* Freeing the client would result in moduleNotifyUserChanged() to be |
no outgoing calls
no test coverage detected