authd: don't call cancel_providers recursively

Also check that they haven't been cancelled while starting up.
This commit is contained in:
Simon Arlott 2016-05-01 10:53:34 +01:00
parent d955cd9f97
commit 9f928dc532
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24
2 changed files with 9 additions and 0 deletions

View file

@ -182,6 +182,11 @@ auth_client_free(struct auth_client *auth)
void void
cancel_providers(struct auth_client *auth) cancel_providers(struct auth_client *auth)
{ {
if(auth->providers_cancelled)
return;
auth->providers_cancelled = true;
if(auth->refcount > 0) if(auth->refcount > 0)
{ {
rb_dlink_node *ptr; 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)) if(!provider->start(auth))
/* Rejected immediately */ /* Rejected immediately */
return; return;
if(auth->providers_cancelled)
break;
} }
auth->providers_starting = false; auth->providers_starting = false;

View file

@ -58,6 +58,7 @@ struct auth_client
char username[USERLEN + 1]; /* Used for ident lookup */ char username[USERLEN + 1]; /* Used for ident lookup */
bool providers_starting; /* Providers are still warming up */ bool providers_starting; /* Providers are still warming up */
bool providers_cancelled; /* Providers are being cancelled */
unsigned int refcount; /* Held references */ unsigned int refcount; /* Held references */
struct auth_client_data *data; /* Provider-specific data */ struct auth_client_data *data; /* Provider-specific data */