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

Comparing ircd-hybrid/trunk/src/client.c (file contents):
Revision 1632 by michael, Sun Nov 4 15:37:10 2012 UTC vs.
Revision 1644 by michael, Tue Nov 6 22:20:16 2012 UTC

# Line 233 | Line 233 | static void
233   check_pings_list(dlink_list *list)
234   {
235    char scratch[32];        /* way too generous but... */
236 <  struct Client *client_p; /* current local client_p being examined */
237 <  int ping, pingwarn;      /* ping time value from client */
238 <  dlink_node *ptr, *next_ptr;
236 >  int ping = 0;      /* ping time value from client */
237 >  dlink_node *ptr = NULL, *next_ptr = NULL;
238  
239    DLINK_FOREACH_SAFE(ptr, next_ptr, list->head)
240    {
241 <    client_p = ptr->data;
241 >    struct Client *client_p = ptr->data;
242  
243      /*
244      ** Note: No need to notify opers here. It's
# Line 252 | Line 251 | check_pings_list(dlink_list *list)
251      }
252  
253      if (!IsRegistered(client_p))
254 <      ping = CONNECTTIMEOUT, pingwarn = 0;
254 >      ping = CONNECTTIMEOUT;
255      else
256 <      ping = get_client_ping(&client_p->localClient->confs, &pingwarn);
256 >      ping = get_client_ping(&client_p->localClient->confs);
257  
258      if (ping < CurrentTime - client_p->localClient->lasttime)
259      {
# Line 266 | Line 265 | check_pings_list(dlink_list *list)
265           * it is still alive.
266           */
267          SetPingSent(client_p);
269        ClearPingWarning(client_p);
268          client_p->localClient->lasttime = CurrentTime - ping;
269          sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p));
270        }
# Line 294 | Line 292 | check_pings_list(dlink_list *list)
292                     (int)(CurrentTime - client_p->localClient->lasttime));
293            exit_client(client_p, &me, scratch);
294          }
297        else if (!IsPingWarning(client_p) && pingwarn > 0 &&
298                 (IsServer(client_p) || IsHandshake(client_p)) &&
299                 CurrentTime - client_p->localClient->lasttime >= ping + pingwarn)
300        {
301          /*
302           * If the server hasn't replied in pingwarn seconds after sending
303           * the PING, notify the opers so that they are aware of the problem.
304           */
305          SetPingWarning(client_p);
306          sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE,
307                               "Warning, no response from %s in %d seconds",
308                               get_client_name(client_p, HIDE_IP), pingwarn);
309          sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE,
310                               "Warning, no response from %s in %d seconds",
311                               get_client_name(client_p, MASK_IP), pingwarn);
312          ilog(LOG_TYPE_IRCD, "No response from %s in %d seconds",
313               get_client_name(client_p, HIDE_IP), pingwarn);
314        }
295        }
296      }
297    }
# Line 367 | Line 347 | check_conf_klines(void)
347      if ((conf = find_dline_conf(&client_p->localClient->ip,
348                                    client_p->localClient->aftype)) != NULL)
349      {
350 <      if (conf->status & CONF_EXEMPT)
350 >      if (conf->type == CONF_EXEMPT)
351          continue;
352  
353        ban_them(client_p, conf);
# Line 422 | Line 402 | check_conf_klines(void)
402      if ((conf = find_dline_conf(&client_p->localClient->ip,
403                                   client_p->localClient->aftype)))
404      {
405 <      if (conf->status & CONF_EXEMPT)
405 >      if (conf->type == CONF_EXEMPT)
406          continue;
407  
408        exit_client(client_p, &me, "D-lined");

Diff Legend

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