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

Comparing ircd-hybrid-7.2/src/s_gline.c (file contents):
Revision 34 by lusky, Sun Oct 2 21:05:51 2005 UTC vs.
Revision 957 by michael, Tue Jul 28 18:47:23 2009 UTC

# Line 43 | Line 43
43   #include "list.h"
44   #include "memory.h"
45  
46 < dlink_list pending_glines = { NULL, NULL, 0 };
46 > dlink_list pending_glines[GLINE_PENDING_ADD_TYPE + 1] = { { NULL, NULL, 0 },
47 >                                                          { NULL, NULL, 0 } };
48  
49 < static void expire_pending_glines(void);
49 > static void expire_pending_glines(struct gline_pending *);
50  
51  
52   struct AccessItem *
# Line 72 | Line 73 | find_is_glined(const char *host, const c
73    }
74  
75    aconf = find_conf_by_address(host, piphost, CONF_GLINE, t, user, NULL);
76 <  return(aconf);
76 >  return aconf;
77   }
78  
79   /* cleanup_glines()
# Line 85 | Line 86 | find_is_glined(const char *host, const c
86   void
87   cleanup_glines(void *unused)
88   {
89 <  expire_pending_glines();
89 >  expire_pending_glines(unused);
90   }
91  
92   /* expire_pending_glines()
# Line 98 | Line 99 | cleanup_glines(void *unused)
99   * enough "votes" in the time period allowed
100   */
101   static void
102 < expire_pending_glines(void)
102 > expire_pending_glines(struct gline_pending *in)
103   {
104 <  dlink_node *ptr;
105 <  dlink_node *next_ptr;
105 <  struct gline_pending *glp_ptr;
104 >  dlink_node *ptr = NULL, *next_ptr = NULL;
105 >  int idx = 0;
106  
107 <  DLINK_FOREACH_SAFE(ptr, next_ptr, pending_glines.head)
107 >  for (; idx < GLINE_PENDING_ADD_TYPE + 1; ++idx)
108    {
109 <    glp_ptr = ptr->data;
110 <
111 <    if (((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <= CurrentTime) ||
112 <        find_is_glined(glp_ptr->host, glp_ptr->user))
109 >    DLINK_FOREACH_SAFE(ptr, next_ptr, pending_glines[idx].head)
110      {
111 <      dlinkDelete(&glp_ptr->node, &pending_glines);
112 <      MyFree(glp_ptr);
111 >      struct gline_pending *glp_ptr = ptr->data;
112 >
113 >      if ((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <= CurrentTime ||
114 >          glp_ptr == in)
115 >      {
116 >        dlinkDelete(&glp_ptr->node, &pending_glines[idx]);
117 >        MyFree(glp_ptr);
118 >      }
119      }
120 +
121 +    ptr = NULL, next_ptr = NULL;
122    }
123   }

Diff Legend

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