authd: don't call cancel_providers recursively
Also check that they haven't been cancelled while starting up.
This commit is contained in:
parent
d955cd9f97
commit
9f928dc532
2 changed files with 9 additions and 0 deletions
|
@ -182,6 +182,11 @@ auth_client_free(struct auth_client *auth)
|
|||
void
|
||||
cancel_providers(struct auth_client *auth)
|
||||
{
|
||||
if(auth->providers_cancelled)
|
||||
return;
|
||||
|
||||
auth->providers_cancelled = true;
|
||||
|
||||
if(auth->refcount > 0)
|
||||
{
|
||||
rb_dlink_node *ptr;
|
||||
|
@ -323,6 +328,9 @@ start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_
|
|||
if(!provider->start(auth))
|
||||
/* Rejected immediately */
|
||||
return;
|
||||
|
||||
if(auth->providers_cancelled)
|
||||
break;
|
||||
}
|
||||
auth->providers_starting = false;
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ struct auth_client
|
|||
char username[USERLEN + 1]; /* Used for ident lookup */
|
||||
|
||||
bool providers_starting; /* Providers are still warming up */
|
||||
bool providers_cancelled; /* Providers are being cancelled */
|
||||
unsigned int refcount; /* Held references */
|
||||
|
||||
struct auth_client_data *data; /* Provider-specific data */
|
||||
|
|
Loading…
Reference in a new issue