265 |
|
{ |
266 |
|
if (!IsPingSent(client_p)) |
267 |
|
{ |
268 |
< |
/* |
269 |
< |
* if we havent PINGed the connection and we havent |
270 |
< |
* heard from it in a while, PING it to make sure |
271 |
< |
* it is still alive. |
272 |
< |
*/ |
273 |
< |
SetPingSent(client_p); |
274 |
< |
client_p->localClient->lasttime = CurrentTime - ping; |
275 |
< |
sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p)); |
268 |
> |
/* |
269 |
> |
* if we havent PINGed the connection and we havent |
270 |
> |
* heard from it in a while, PING it to make sure |
271 |
> |
* it is still alive. |
272 |
> |
*/ |
273 |
> |
SetPingSent(client_p); |
274 |
> |
client_p->localClient->lasttime = CurrentTime - ping; |
275 |
> |
sendto_one(client_p, "PING :%s", ID_or_name(&me, client_p)); |
276 |
|
} |
277 |
|
else |
278 |
|
{ |
283 |
|
* and it has a ping time, then close its connection. |
284 |
|
*/ |
285 |
|
if (IsServer(client_p) || IsHandshake(client_p)) |
286 |
< |
{ |
287 |
< |
sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, |
288 |
< |
"No response from %s, closing link", |
289 |
< |
get_client_name(client_p, HIDE_IP)); |
290 |
< |
sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, |
291 |
< |
"No response from %s, closing link", |
292 |
< |
get_client_name(client_p, MASK_IP)); |
293 |
< |
ilog(LOG_TYPE_IRCD, "No response from %s, closing link", |
294 |
< |
get_client_name(client_p, HIDE_IP)); |
295 |
< |
} |
286 |
> |
{ |
287 |
> |
sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, |
288 |
> |
"No response from %s, closing link", |
289 |
> |
get_client_name(client_p, HIDE_IP)); |
290 |
> |
sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, |
291 |
> |
"No response from %s, closing link", |
292 |
> |
get_client_name(client_p, MASK_IP)); |
293 |
> |
ilog(LOG_TYPE_IRCD, "No response from %s, closing link", |
294 |
> |
get_client_name(client_p, HIDE_IP)); |
295 |
> |
} |
296 |
|
|
297 |
|
snprintf(scratch, sizeof(scratch), "Ping timeout: %d seconds", |
298 |
|
(int)(CurrentTime - client_p->localClient->lasttime)); |
354 |
|
client_p->localClient->aftype)) != NULL) |
355 |
|
{ |
356 |
|
if (conf->type == CONF_EXEMPT) |
357 |
< |
continue; |
357 |
> |
continue; |
358 |
|
|
359 |
|
ban_them(client_p, conf); |
360 |
|
continue; /* and go examine next fd/client_p */ |
425 |
|
static void |
426 |
|
ban_them(struct Client *client_p, struct MaskItem *conf) |
427 |
|
{ |
428 |
< |
const char *user_reason = NULL; /* What is sent to user */ |
428 |
> |
const char *user_reason = NULL; /* What is sent to user */ |
429 |
|
const char *type_string = NULL; |
430 |
|
const char dline_string[] = "D-line"; |
431 |
|
const char kline_string[] = "K-line"; |
459 |
|
|
460 |
|
if (IsClient(client_p)) |
461 |
|
sendto_one(client_p, form_str(ERR_YOUREBANNEDCREEP), |
462 |
< |
me.name, client_p->name, user_reason); |
462 |
> |
me.name, client_p->name, user_reason); |
463 |
|
|
464 |
|
exit_client(client_p, &me, user_reason); |
465 |
|
} |
539 |
|
return NULL; |
540 |
|
|
541 |
|
if ((who = get_history(user, |
542 |
< |
(time_t)ConfigFileEntry.kill_chase_time_limit)) |
543 |
< |
== NULL) |
542 |
> |
(time_t)ConfigFileEntry.kill_chase_time_limit)) |
543 |
> |
== NULL) |
544 |
|
{ |
545 |
|
sendto_one(source_p, form_str(ERR_NOSUCHNICK), |
546 |
|
me.name, source_p->name, user); |
866 |
|
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE, |
867 |
|
"CLIEXIT: %s %s %s %s 0 %s", |
868 |
|
source_p->name, |
869 |
< |
source_p->username, |
870 |
< |
source_p->host, |
869 |
> |
source_p->username, |
870 |
> |
source_p->host, |
871 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
872 |
|
"255.255.255.255" : source_p->sockhost, |
873 |
< |
comment); |
873 |
> |
comment); |
874 |
|
ilog(LOG_TYPE_USER, "%s (%3u:%02u:%02u): %s!%s@%s %llu/%llu", |
875 |
|
myctime(source_p->localClient->firsttime), (unsigned int)(on_for / 3600), |
876 |
|
(unsigned int)((on_for % 3600)/60), (unsigned int)(on_for % 60), |
894 |
|
{ |
895 |
|
/* for them, we are exiting the network */ |
896 |
|
sendto_one(source_p, ":%s SQUIT %s :%s", |
897 |
< |
ID_or_name(from, source_p), me.name, comment); |
897 |
> |
ID_or_name(from, source_p), me.name, comment); |
898 |
|
} |
899 |
|
|
900 |
|
sendto_one(source_p, "ERROR :Closing Link: %s (%s)", |
1021 |
|
{ |
1022 |
|
/* Admins get the real IP */ |
1023 |
|
sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, |
1024 |
< |
"Server %s closed the connection", |
1025 |
< |
get_client_name(client_p, SHOW_IP)); |
1024 |
> |
"Server %s closed the connection", |
1025 |
> |
get_client_name(client_p, SHOW_IP)); |
1026 |
|
|
1027 |
|
/* Opers get a masked IP */ |
1028 |
|
sendto_realops_flags(UMODE_ALL, L_OPER, SEND_NOTICE, |
1029 |
< |
"Server %s closed the connection", |
1030 |
< |
get_client_name(client_p, MASK_IP)); |
1029 |
> |
"Server %s closed the connection", |
1030 |
> |
get_client_name(client_p, MASK_IP)); |
1031 |
|
|
1032 |
|
ilog(LOG_TYPE_IRCD, "Server %s closed the connection", |
1033 |
< |
get_client_name(client_p, SHOW_IP)); |
1033 |
> |
get_client_name(client_p, SHOW_IP)); |
1034 |
|
} |
1035 |
|
else |
1036 |
|
{ |
1037 |
|
report_error(L_ADMIN, "Lost connection to %s: %s", |
1038 |
< |
get_client_name(client_p, SHOW_IP), current_error); |
1038 |
> |
get_client_name(client_p, SHOW_IP), current_error); |
1039 |
|
report_error(L_OPER, "Lost connection to %s: %s", |
1040 |
< |
get_client_name(client_p, MASK_IP), current_error); |
1040 |
> |
get_client_name(client_p, MASK_IP), current_error); |
1041 |
|
} |
1042 |
|
|
1043 |
|
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, |
1044 |
< |
"%s had been connected for %d day%s, %2d:%02d:%02d", |
1045 |
< |
client_p->name, connected/86400, |
1046 |
< |
(connected/86400 == 1) ? "" : "s", |
1047 |
< |
(connected % 86400) / 3600, (connected % 3600) / 60, |
1048 |
< |
connected % 60); |
1044 |
> |
"%s had been connected for %d day%s, %2d:%02d:%02d", |
1045 |
> |
client_p->name, connected/86400, |
1046 |
> |
(connected/86400 == 1) ? "" : "s", |
1047 |
> |
(connected % 86400) / 3600, (connected % 3600) / 60, |
1048 |
> |
connected % 60); |
1049 |
|
} |
1050 |
|
|
1051 |
|
if (error == 0) |