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 |
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 |
|
{ |
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 |
|
} |
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 |
|
} |
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); |
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"); |