mirror of
https://github.com/matrix-construct/construct
synced 2024-11-15 22:41:12 +01:00
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
|
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;
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
Loading…
Reference in a new issue