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

Comparing ircd-hybrid/trunk/src/conf_resv.c (file contents):
Revision 8963 by michael, Sat May 11 21:06:49 2019 UTC vs.
Revision 8972 by michael, Sat May 18 12:54:17 2019 UTC

# Line 55 | Line 55 | resv_nick_get_list(void)
55   }
56  
57   void
58 < resv_delete(struct ResvItem *resv)
58 > resv_delete(struct ResvItem *resv, bool expired)
59   {
60 +  if (expired == true)
61 +    sendto_realops_flags(UMODE_EXPIRATION, L_ALL, SEND_NOTICE, "Temporary RESV for [%s] expired",
62 +                         resv->mask);
63 +
64    while (resv->exempt_list.head)
65    {
66      struct ResvExemptItem *exempt = resv->exempt_list.head->data;
# Line 136 | Line 140 | resv_make(const char *mask, const char *
140   struct ResvItem *
141   resv_find(const char *name, int (*compare)(const char *, const char *))
142   {
143 <  dlink_node *node;
143 >  dlink_node *node, *node_next;
144    dlink_list *list;
145  
146    if (IsChanPrefix(*name))
# Line 144 | Line 148 | resv_find(const char *name, int (*compar
148    else
149      list = &resv_nick_list;
150  
151 <  DLINK_FOREACH(node, list->head)
151 >  DLINK_FOREACH_SAFE(node, node_next, list->head)
152    {
153      struct ResvItem *resv = node->data;
154  
155 <    if (compare(resv->mask, name) == 0)
155 >    if (resv->expire &&
156 >        (resv->expire <= event_base->time.sec_real))
157 >      resv_delete(resv, true);
158 >    else if (compare(resv->mask, name) == 0)
159        return resv;
160    }
161  
# Line 205 | Line 212 | resv_clear(void)
212        struct ResvItem *resv = node->data;
213  
214        if (resv->in_database == false)
215 <        resv_delete(resv);
215 >        resv_delete(resv, false);
216      }
217    }
218   }
# Line 223 | Line 230 | resv_expire(void)
230      {
231        struct ResvItem *resv = node->data;
232  
233 <      if (resv->expire == 0 || resv->expire > event_base->time.sec_real)
234 <        continue;
235 <
229 <      sendto_realops_flags(UMODE_EXPIRATION, L_ALL, SEND_NOTICE, "Temporary RESV for [%s] expired",
230 <                           resv->mask);
231 <      resv_delete(resv);
233 >      if (resv->expire &&
234 >          (resv->expire <= event_base->time.sec_real))
235 >        resv_delete(resv, true);
236      }
237    }
238   }

Diff Legend

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