diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-25 23:14:19 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-25 23:14:19 +0000 |
commit | 612988aeb323df99c68c3082384b2bdd39e7eb86 (patch) | |
tree | 8542fe77c8c948079a55f522c68cf73d6cfbf5c7 /src | |
parent | bbfb8b0de3093bf0e85b4aab85bc5cf74294637c (diff) |
- s_auth.c, s_auth.h: optimized so we save unecessary auth_doing_list
traversals. Patch provided by Adam.
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2930 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/s_auth.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/s_auth.c b/src/s_auth.c index 157e9b0..bf0727a 100644 --- a/src/s_auth.c +++ b/src/s_auth.c @@ -126,8 +126,11 @@ release_auth_client(struct AuthRequest *auth) if (IsDoingAuth(auth) || IsDNSPending(auth)) return; - if (dlinkFind(&auth_doing_list, auth)) + if (IsInAuth(auth)) + { dlinkDelete(&auth->node, &auth_doing_list); + ClearInAuth(auth); + } /* * When a client has auth'ed, we want to start reading what it sends @@ -368,7 +371,8 @@ start_auth(struct Client *client) assert(client != NULL); auth = make_auth_request(client); - dlinkAdd(auth, &auth->node, &auth_doing_list); + SetInAuth(auth); + dlinkAddTail(auth, &auth->node, &auth_doing_list); sendheader(client, REPORT_DO_DNS); @@ -397,7 +401,7 @@ timeout_auth_queries_event(void *notused) struct AuthRequest *auth = ptr->data; if (auth->timeout > CurrentTime) - continue; + break; if (IsDoingAuth(auth)) { @@ -588,6 +592,9 @@ delete_auth(struct AuthRequest *auth) if (IsDoingAuth(auth)) fd_close(&auth->fd); - if (dlinkFind(&auth_doing_list, auth)) + if (IsInAuth(auth)) + { dlinkDelete(&auth->node, &auth_doing_list); + ClearInAuth(auth); + } } |