ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/auth.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/s_auth.c (file contents):
Revision 2180 by michael, Sun Mar 31 17:09:50 2013 UTC vs.
Revision 2181 by michael, Tue Jun 4 11:03:41 2013 UTC

# Line 76 | Line 76 | enum {
76  
77   #define sendheader(c, i) sendto_one((c), HeaderMessages[(i)], me.name)
78  
79 static mp_pool_t *auth_pool = NULL;
79   static dlink_list auth_doing_list = { NULL, NULL, 0 };
80  
81   static EVH timeout_auth_queries_event;
82  
83   static PF read_auth_reply;
84   static CNCB auth_connect_callback;
86 static CBFUNC start_auth;
87
88 struct Callback *auth_cb = NULL;
85  
86   /* auth_init
87   *
# Line 94 | Line 90 | struct Callback *auth_cb = NULL;
90   void
91   auth_init(void)
92   {
97  auth_pool = mp_pool_new(sizeof(struct AuthRequest), MP_CHUNK_SIZE_AUTH);
98  auth_cb = register_callback("start_auth", start_auth);
93    eventAddIsh("timeout_auth_queries_event", timeout_auth_queries_event, NULL, 1);
94   }
95  
# Line 105 | Line 99 | auth_init(void)
99   static struct AuthRequest *
100   make_auth_request(struct Client *client)
101   {
102 <  struct AuthRequest *request = mp_pool_get(auth_pool);
102 >  struct AuthRequest *request = &client->localClient->auth;
103  
104    memset(request, 0, sizeof(*request));
105 <  client->localClient->auth = request;
106 <  request->client           = client;
107 <  request->timeout          = CurrentTime + CONNECTTIMEOUT;
105 >
106 >  request->client  = client;
107 >  request->timeout = CurrentTime + CONNECTTIMEOUT;
108  
109    return request;
110   }
# Line 128 | Line 122 | release_auth_client(struct AuthRequest *
122    if (IsDoingAuth(auth) || IsDNSPending(auth))
123      return;
124  
125 <  client->localClient->auth = NULL;
126 <  dlinkDelete(&auth->node, &auth_doing_list);
133 <  mp_pool_release(auth);
125 >  if (dlinkFind(&auth_doing_list, auth))
126 >    dlinkDelete(&auth->node, &auth_doing_list);
127  
128    /*
129     * When a client has auth'ed, we want to start reading what it sends
# Line 363 | Line 356 | GetValidIdent(char *buf)
356   * output       - NONE
357   * side effects - starts auth (identd) and dns queries for a client
358   */
359 < static void *
360 < start_auth(va_list args)
359 > void
360 > start_auth(struct Client *client)
361   {
369  struct Client *client = va_arg(args, struct Client *);
362    struct AuthRequest *auth = NULL;
363  
364    assert(client != NULL);
# Line 385 | Line 377 | start_auth(va_list args)
377    }
378  
379    gethost_byaddr(auth_dns_callback, auth, &client->localClient->ip);
388
389  return NULL;
380   }
381  
382   /*
# Line 594 | Line 584 | delete_auth(struct AuthRequest *auth)
584    if (IsDoingAuth(auth))
585      fd_close(&auth->fd);
586  
587 <  dlinkDelete(&auth->node, &auth_doing_list);
588 <  mp_pool_release(auth);
587 >  if (dlinkFind(&auth_doing_list, auth))
588 >    dlinkDelete(&auth->node, &auth_doing_list);
589   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)