X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=5d086857dcd2f634ab4ec5b506d57ddf3f9d3ce2;hb=161adbb1aa6235acda9677ab14edd19581d9fcf4;hp=81a0f4507eed0fb79d470bf323452bd1a328dd58;hpb=f37600ee01f6cfd86e8fa80f77ee26ebaf3012b2;p=ngircd-alex.git diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 81a0f450..5d086857 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -47,10 +47,6 @@ # include #endif -#ifdef HAVE_STDINT_H -# include /* e.g. for Mac OS X */ -#endif - #ifdef TCPWRAP # include /* for TCP Wrappers */ #endif @@ -67,6 +63,7 @@ #include "client.h" #include "class.h" #include "conf.h" +#include "conn-encoding.h" #include "conn-ssl.h" #include "conn-zip.h" #include "conn-func.h" @@ -865,6 +862,9 @@ va_dcl #endif { char buffer[COMMAND_LEN]; +#ifdef ICONV + char *ptr, *message; +#endif size_t len; bool ok; va_list ap; @@ -905,6 +905,16 @@ va_dcl CUT_TXTSUFFIX); } +#ifdef ICONV + ptr = strchr(buffer + 1, ':'); + if (ptr) { + ptr++; + message = Conn_EncodingTo(Idx, ptr); + if (message != ptr) + strlcpy(ptr, message, sizeof(buffer) - (ptr - buffer)); + } +#endif + #ifdef SNIFFER if (NGIRCd_Sniffer) Log(LOG_DEBUG, " -> connection %d: '%s'.", Idx, buffer); @@ -1366,7 +1376,7 @@ Count_Connections(ng_ipaddr_t *a) * @returns Accepted socket descriptor or -1 on error. */ static int -New_Connection(int Sock, bool IsSSL) +New_Connection(int Sock, UNUSED bool IsSSL) { #ifdef TCPWRAP struct request_info req; @@ -2109,6 +2119,11 @@ Init_Conn_Struct(CONN_ID Idx) My_Connections[Idx].lastdata = now; My_Connections[Idx].lastprivmsg = now; Proc_InitStruct(&My_Connections[Idx].proc_stat); + +#ifdef ICONV + My_Connections[Idx].iconv_from = (iconv_t)(-1); + My_Connections[Idx].iconv_to = (iconv_t)(-1); +#endif } /* Init_Conn_Struct */