diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-06-04 10:55:19 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-06-04 10:55:19 +0000 |
commit | 966226823c39b8952f8db398cf5cc1081746ef4a (patch) | |
tree | 90919e07aead12067a3ca839bebdbde097776db2 /src/s_auth.c | |
parent | 512fa99402ef1d4d34d255236d45d635221aec25 (diff) |
- Fixed debug assertion being triggered on ident lookup
as reported by Stuart Walsh
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2180 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src/s_auth.c')
-rw-r--r-- | src/s_auth.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/s_auth.c b/src/s_auth.c index 9be758f..af6defb 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -76,16 +76,12 @@ enum { #define sendheader(c, i) sendto_one((c), HeaderMessages[(i)], me.name) -static mp_pool_t *auth_pool = NULL; static dlink_list auth_doing_list = { NULL, NULL, 0 }; static EVH timeout_auth_queries_event; static PF read_auth_reply; static CNCB auth_connect_callback; -static CBFUNC start_auth; - -struct Callback *auth_cb = NULL; /* auth_init * @@ -94,8 +90,6 @@ struct Callback *auth_cb = NULL; void auth_init(void) { - auth_pool = mp_pool_new(sizeof(struct AuthRequest), MP_CHUNK_SIZE_AUTH); - auth_cb = register_callback("start_auth", start_auth); eventAddIsh("timeout_auth_queries_event", timeout_auth_queries_event, NULL, 1); } @@ -105,12 +99,12 @@ auth_init(void) static struct AuthRequest * make_auth_request(struct Client *client) { - struct AuthRequest *request = mp_pool_get(auth_pool); + struct AuthRequest *request = &client->localClient->auth; memset(request, 0, sizeof(*request)); - client->localClient->auth = request; - request->client = client; - request->timeout = CurrentTime + CONNECTTIMEOUT; + + request->client = client; + request->timeout = CurrentTime + CONNECTTIMEOUT; return request; } @@ -128,9 +122,8 @@ release_auth_client(struct AuthRequest *auth) if (IsDoingAuth(auth) || IsDNSPending(auth)) return; - client->localClient->auth = NULL; - dlinkDelete(&auth->node, &auth_doing_list); - mp_pool_release(auth); + if (dlinkFind(&auth_doing_list, auth)) + dlinkDelete(&auth->node, &auth_doing_list); /* * When a client has auth'ed, we want to start reading what it sends @@ -363,10 +356,9 @@ GetValidIdent(char *buf) * output - NONE * side effects - starts auth (identd) and dns queries for a client */ -static void * -start_auth(va_list args) +void +start_auth(struct Client *client) { - struct Client *client = va_arg(args, struct Client *); struct AuthRequest *auth = NULL; assert(client != NULL); @@ -385,8 +377,6 @@ start_auth(va_list args) } gethost_byaddr(auth_dns_callback, auth, &client->localClient->ip); - - return NULL; } /* @@ -594,6 +584,6 @@ delete_auth(struct AuthRequest *auth) if (IsDoingAuth(auth)) fd_close(&auth->fd); - dlinkDelete(&auth->node, &auth_doing_list); - mp_pool_release(auth); + if (dlinkFind(&auth_doing_list, auth)) + dlinkDelete(&auth->node, &auth_doing_list); } |