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

Comparing ircd-hybrid-7.2/src/s_auth.c (file contents):
Revision 997 by michael, Mon Aug 17 19:19:16 2009 UTC vs.
Revision 998 by michael, Sun Aug 23 12:43:17 2009 UTC

# Line 37 | Line 37
37   #include "list.h"
38   #include "s_auth.h"
39   #include "s_conf.h"
40 + #include "balloc.h"
41   #include "client.h"
42   #include "common.h"
43   #include "event.h"
# Line 77 | Line 78 | enum {
78  
79   #define sendheader(c, i) sendto_one((c), HeaderMessages[(i)], me.name)
80  
81 + static BlockHeap *auth_heap = NULL;
82   static dlink_list auth_doing_list = { NULL, NULL, 0 };
83  
84   static EVH timeout_auth_queries_event;
# Line 94 | Line 96 | struct Callback *auth_cb = NULL;
96   void
97   init_auth(void)
98   {
99 +  auth_heap = BlockHeapCreate("auth", sizeof(struct AuthRequest), AUTH_HEAP_SIZE);
100    auth_cb = register_callback("start_auth", start_auth);
101    eventAddIsh("timeout_auth_queries_event", timeout_auth_queries_event, NULL, 1);
102   }
# Line 104 | Line 107 | init_auth(void)
107   static struct AuthRequest *
108   make_auth_request(struct Client *client)
109   {
110 <  struct AuthRequest *request = MyMalloc(sizeof(struct AuthRequest));
110 >  struct AuthRequest *request = BlockHeapAlloc(auth_heap);
111  
112    client->localClient->auth = request;
113    request->client           = client;
# Line 128 | Line 131 | release_auth_client(struct AuthRequest *
131  
132    client->localClient->auth = NULL;
133    dlinkDelete(&auth->node, &auth_doing_list);
134 +  BlockHeapFree(auth_heap, auth);
135  
136    /*
137     * When a client has auth'ed, we want to start reading what it sends
# Line 147 | Line 151 | release_auth_client(struct AuthRequest *
151  
152   /*
153   * auth_dns_callback - called when resolver query finishes
154 < * if the query resulted in a successful search, hp will contain
155 < * a non-null pointer, otherwise hp will be null.
154 > * if the query resulted in a successful search, name will contain
155 > * a non-NULL pointer, otherwise name will be NULL.
156   * set the client on it's way to a connection completion, regardless
157   * of success of failure
158   */
# Line 406 | Line 410 | timeout_auth_queries_event(void *notused
410      if (IsDoingAuth(auth))
411      {  
412        ++ServerStats.is_abad;
413 +      ClearAuth(auth);
414        sendheader(auth->client, REPORT_FAIL_ID);
415      }
416  
417      if (IsDNSPending(auth))
418      {
419        delete_resolver_queries(auth);
420 +      ClearDNSPending(auth);
421        sendheader(auth->client, REPORT_FAIL_DNS);
422      }
423  
# Line 595 | Line 601 | delete_auth(struct AuthRequest *auth)
601  
602    fd_close(&auth->fd);
603    dlinkDelete(&auth->node, &auth_doing_list);
604 <  MyFree(auth);
604 >  BlockHeapFree(auth_heap, auth);
605   }

Diff Legend

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