X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc.c;h=ad8c0506905eca3fdaf5787914be740b7a4b9e21;hp=d6a751a0d427edb091603ad62f54f3083de57ca7;hb=52ccba5d1e8cd2e648cf3c14598332bde6b9910d;hpb=fcf61e9e0264d081e72eedddbd4a45b619e82b01 diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c index d6a751a0..ad8c0506 100644 --- a/src/ngircd/irc.c +++ b/src/ngircd/irc.c @@ -1,6 +1,6 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2013 Alexander Barton (alex@barton.de) and Contributors. + * Copyright (c)2001-2015 Alexander Barton (alex@barton.de) and Contributors. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,17 +16,19 @@ * IRC commands */ -#include "imp.h" #include #include #include +#include +#include #include "ngircd.h" #include "conn-func.h" #include "conf.h" #include "channel.h" -#include "conn-encoding.h" -#include "defines.h" +#ifdef ICONV +# include "conn-encoding.h" +#endif #include "irc-macros.h" #include "irc-write.h" #include "log.h" @@ -34,9 +36,7 @@ #include "messages.h" #include "parse.h" #include "op.h" -#include "tool.h" -#include "exp.h" #include "irc.h" static char *Option_String PARAMS((CONN_ID Idx)); @@ -240,7 +240,7 @@ IRC_TRACE(CLIENT *Client, REQUEST *Req) PACKAGE_VERSION, Client_ID(target), Client_ID(Client_NextHop(target)), Option_String(idx2), - time(NULL) - Conn_StartTime(idx2), + (long)(time(NULL) - Conn_StartTime(idx2)), Conn_SendQ(idx), Conn_SendQ(idx2))) return DISCONNECTED; @@ -339,9 +339,12 @@ GLOBAL bool IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reason) { const char *msg; - CONN_ID my_conn, conn; + CONN_ID my_conn = NONE, conn; CLIENT *c; + assert(Nick != NULL); + assert(Reason != NULL); + /* Do we know such a client in the network? */ c = Client_Search(Nick); if (!c) { @@ -376,7 +379,8 @@ IRC_KillClient(CLIENT *Client, CLIENT *From, const char *Nick, const char *Reaso } /* Save ID of this connection */ - my_conn = Client_Conn(Client); + if (Client) + my_conn = Client_Conn(Client); /* Kill the client NOW: * - Close the local connection (if there is one), @@ -526,7 +530,7 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors) Client_ID(Client), Req->command); } - if (Client_Type(Client) == CLIENT_SERVER) + if (Client_Type(Client) == CLIENT_SERVER && Req->prefix) from = Client_Search(Req->prefix); else from = Client;