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-8/src/s_auth.c (file contents), Revision 1241 by michael, Thu Sep 29 20:26:09 2011 UTC vs.
ircd-hybrid/trunk/src/s_auth.c (file contents), Revision 1654 by michael, Fri Nov 16 19:39:37 2012 UTC

# Line 32 | Line 32
32   *     any messages from it.
33   *     --Bleep  Thomas Helvey <tomh@inxpress.net>
34   */
35 +
36   #include "stdinc.h"
37   #include "list.h"
38   #include "ircd_defs.h"
39   #include "fdlist.h"
40   #include "s_auth.h"
41 < #include "s_conf.h"
41 < #include "balloc.h"
41 > #include "conf.h"
42   #include "client.h"
43 – #include "common.h"
43   #include "event.h"
44   #include "hook.h"
45   #include "irc_string.h"
# Line 48 | Line 47
47   #include "packet.h"
48   #include "irc_res.h"
49   #include "s_bsd.h"
50 < #include "s_log.h"
50 > #include "log.h"
51   #include "send.h"
52 + #include "mempool.h"
53  
54  
55   static const char *HeaderMessages[] = {
# Line 76 | Line 76 | enum {
76  
77   #define sendheader(c, i) sendto_one((c), HeaderMessages[(i)], me.name)
78  
79 < static BlockHeap *auth_heap = NULL;
79 > static mp_pool_t *auth_pool = NULL;
80   static dlink_list auth_doing_list = { NULL, NULL, 0 };
81  
82   static EVH timeout_auth_queries_event;
# Line 94 | Line 94 | struct Callback *auth_cb = NULL;
94   void
95   init_auth(void)
96   {
97 <  auth_heap = BlockHeapCreate("auth", sizeof(struct AuthRequest), AUTH_HEAP_SIZE);
97 >  auth_pool = mp_pool_new(sizeof(struct AuthRequest), MP_CHUNK_SIZE_AUTH);
98    auth_cb = register_callback("start_auth", start_auth);
99    eventAddIsh("timeout_auth_queries_event", timeout_auth_queries_event, NULL, 1);
100   }
# Line 105 | Line 105 | init_auth(void)
105   static struct AuthRequest *
106   make_auth_request(struct Client *client)
107   {
108 <  struct AuthRequest *request = BlockHeapAlloc(auth_heap);
108 >  struct AuthRequest *request = mp_pool_get(auth_pool);
109  
110 +  memset(request, 0, sizeof(*request));
111    client->localClient->auth = request;
112    request->client           = client;
113    request->timeout          = CurrentTime + CONNECTTIMEOUT;
# Line 129 | Line 130 | release_auth_client(struct AuthRequest *
130  
131    client->localClient->auth = NULL;
132    dlinkDelete(&auth->node, &auth_doing_list);
133 <  BlockHeapFree(auth_heap, auth);
133 >  mp_pool_release(auth);
134  
135    /*
136     * When a client has auth'ed, we want to start reading what it sends
# Line 250 | Line 251 | start_auth_query(struct AuthRequest *aut
251    {
252      report_error(L_ALL, "creating auth stream socket %s:%s",
253          get_client_name(auth->client, SHOW_IP), errno);
254 <    ilog(L_ERROR, "Unable to create auth socket for %s",
254 >    ilog(LOG_TYPE_IRCD, "Unable to create auth socket for %s",
255          get_client_name(auth->client, SHOW_IP));
256      ++ServerStats.is_abad;
257      return 0;
# Line 419 | Line 420 | timeout_auth_queries_event(void *notused
420        sendheader(auth->client, REPORT_FAIL_DNS);
421      }
422  
423 <    ilog(L_INFO, "DNS/AUTH timeout %s",
423 >    ilog(LOG_TYPE_IRCD, "DNS/AUTH timeout %s",
424           get_client_name(auth->client, SHOW_IP));
425      release_auth_client(auth);
426    }
# Line 463 | Line 464 | auth_connect_callback(fde_t *fd, int err
464        getpeername(auth->client->localClient->fd.fd, (struct sockaddr *)&them,
465        &tlen))
466    {
467 <    ilog(L_INFO, "auth get{sock,peer}name error for %s",
467 >    ilog(LOG_TYPE_IRCD, "auth get{sock,peer}name error for %s",
468          get_client_name(auth->client, SHOW_IP));
469      auth_error(auth);
470      return;
# Line 594 | Line 595 | delete_auth(struct AuthRequest *auth)
595      fd_close(&auth->fd);
596  
597    dlinkDelete(&auth->node, &auth_doing_list);
598 <  BlockHeapFree(auth_heap, auth);
598 >  mp_pool_release(auth);
599   }

Diff Legend

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