X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..c98390004f4f14cd8215302d77313f81e2546e22:/src/client.c diff --git a/src/client.c b/src/client.c index eea5429..bb0f472 100644 --- a/src/client.c +++ b/src/client.c @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: client.c 1861 2006-08-26 23:21:42Z jilles $ + * $Id: client.c 3514 2007-06-06 16:25:21Z nenolod $ */ #include "stdinc.h" #include "config.h" @@ -58,6 +58,8 @@ #include "msg.h" #include "monitor.h" #include "blacklist.h" +#include "reject.h" +#include "scache.h" #define DEBUG_EXITED_CLIENTS @@ -1099,7 +1101,7 @@ free_exited_clients(void *unused) target_p->name, (unsigned int) target_p->status, target_p->flags, target_p->flags2, target_p->handler); sendto_realops_snomask(SNO_GENERAL, L_ALL, - "Please report this to the ratbox developers!"); + "Please report this to the charybdis developers!"); found++; } } @@ -1284,7 +1286,7 @@ exit_aborted_clients(void *unused) abt->client->name, (unsigned int) abt->client->status, abt->client->flags, abt->client->flags2, abt->client->handler); sendto_realops_snomask(SNO_GENERAL, L_ALL, - "Please report this to the ratbox developers!"); + "Please report this to the charybdis developers!"); continue; } } @@ -1419,10 +1421,13 @@ exit_unknown_client(struct Client *client_p, struct Client *source_p, struct Cli { delete_auth_queries(source_p); client_flush_input(source_p); + del_unknown_ip(source_p); dlinkDelete(&source_p->localClient->tnode, &unknown_list); if(!IsIOError(source_p)) - sendto_one(source_p, "ERROR :Closing Link: 127.0.0.1 (%s)", comment); + sendto_one(source_p, "ERROR :Closing Link: %s (%s)", + source_p->user != NULL ? source_p->host : "127.0.0.1", + comment); close_connection(source_p); @@ -1432,7 +1437,6 @@ exit_unknown_client(struct Client *client_p, struct Client *source_p, struct Cli del_from_hostname_hash(source_p->host, source_p); del_from_client_hash(source_p->name, source_p); remove_client_from_list(source_p); - free_pre_client(source_p); SetDead(source_p); dlinkAddAlloc(source_p, &dead_list); @@ -1452,11 +1456,7 @@ exit_remote_server(struct Client *client_p, struct Client *source_p, struct Clie strcpy(comment1, "*.net *.split"); else { - if((source_p->serv) && (source_p->serv->up)) - strcpy(comment1, source_p->serv->up); - else - strcpy(comment1, ""); - + strcpy(comment1, source_p->servptr->name); strcat(comment1, " "); strcat(comment1, source_p->name); } @@ -1488,6 +1488,7 @@ exit_remote_server(struct Client *client_p, struct Client *source_p, struct Clie del_from_client_hash(source_p->name, source_p); remove_client_from_list(source_p); + scache_split(source_p->serv->nameinfo); SetDead(source_p); #ifdef DEBUG_EXITED_CLIENTS @@ -1552,12 +1553,6 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien source_p->name, comment); } - if(source_p->localClient->ctrlfd >= 0) - { - comm_close(source_p->localClient->ctrlfd); - source_p->localClient->ctrlfd = -1; - } - if(source_p->servptr && source_p->servptr->serv) dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers); else @@ -1570,11 +1565,7 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien strcpy(comment1, "*.net *.split"); else { - if((source_p->serv) && (source_p->serv->up)) - strcpy(comment1, source_p->serv->up); - else - strcpy(comment1, ""); - + strcpy(comment1, source_p->servptr->name); strcat(comment1, " "); strcat(comment1, source_p->name); } @@ -1594,6 +1585,7 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien del_from_client_hash(source_p->name, source_p); remove_client_from_list(source_p); + scache_split(source_p->serv->nameinfo); SetDead(source_p); dlinkAddAlloc(source_p, &dead_list); @@ -2103,13 +2095,10 @@ close_connection(struct Client *client_p) client_p->localClient->fd = -1; } - if(HasServlink(client_p)) + if(-1 < client_p->localClient->ctrlfd) { - if(client_p->localClient->fd > -1) - { - comm_close(client_p->localClient->ctrlfd); - client_p->localClient->ctrlfd = -1; - } + comm_close(client_p->localClient->ctrlfd); + client_p->localClient->ctrlfd = -1; } linebuf_donebuf(&client_p->localClient->buf_sendq);