From 434627083613f016d432462fce73f728dd77172e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 6 Jan 2008 12:37:55 +0000 Subject: More consistency in error/warning errors. Until now "WARNING:" was usually in upper case while "Error:" wasn't .... that doesn't really make sense. --- irc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 01d4c47e..2b86aebb 100644 --- a/irc.c +++ b/irc.c @@ -325,7 +325,7 @@ void irc_process( irc_t *irc ) if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) == -1 ) { if( irc->status & USTATUS_LOGGED_IN ) - irc_usermsg( irc, "ERROR: Charset mismatch detected. The charset " + irc_usermsg( irc, "Error: Charset mismatch detected. The charset " "setting is currently set to %s, so please make " "sure your IRC client will send and accept text in " "that charset, or tell BitlBee which charset to " -- cgit v1.2.3 From fc0cf92a81086903914056b32663479909a6fbff Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 13 Jan 2008 00:15:12 +0000 Subject: Different handling of charset mismatches before login time. Ignoring a USER command because of encoding issues isn't too great, so let's simply replace them. The information isn't really used anywhere anyway. --- irc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 2b86aebb..972e030e 100644 --- a/irc.c +++ b/irc.c @@ -324,7 +324,10 @@ void irc_process( irc_t *irc ) conv[IRC_MAX_LINE] = 0; if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) == -1 ) { + /* GLib can do strange things if things are not in the expected charset, + so let's be a little bit paranoid here: */ if( irc->status & USTATUS_LOGGED_IN ) + { irc_usermsg( irc, "Error: Charset mismatch detected. The charset " "setting is currently set to %s, so please make " "sure your IRC client will send and accept text in " @@ -332,7 +335,18 @@ void irc_process( irc_t *irc ) "expect by changing the charset setting. See " "`help set charset' for more information. Your " "message was ignored.", cs ); - *conv = 0; + *conv = 0; + } + else + { + irc_write( irc, ":%s NOTICE AUTH :%s", irc->myhost, + "Warning: invalid (non-UTF8) characters received at login time." ); + + strncpy( conv, lines[i], IRC_MAX_LINE ); + for( temp = conv; *temp; temp ++ ) + if( *temp & 0x80 ) + *temp = '?'; + } } lines[i] = conv; } -- cgit v1.2.3 From 0fbda19314c806e3e677847f3c977eb5a1bc2b61 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 2 Feb 2008 21:48:09 +0000 Subject: Added help_free() and cleaned up some very stale help-related stuff I wasn't even aware of. This closes bug #352. --- irc.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 972e030e..2510e3d9 100644 --- a/irc.c +++ b/irc.c @@ -188,7 +188,6 @@ void irc_free(irc_t * irc) { account_t *account; user_t *user, *usertmp; - help_t *helpnode, *helpnodetmp; log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd ); @@ -265,16 +264,6 @@ void irc_free(irc_t * irc) g_hash_table_foreach_remove(irc->watches, irc_free_hashkey, NULL); g_hash_table_destroy(irc->watches); - if (irc->help != NULL) { - helpnode = irc->help; - while (helpnode != NULL) { - g_free(helpnode->string); - - helpnodetmp = helpnode; - helpnode = helpnode->next; - g_free(helpnodetmp); - } - } g_free(irc); if( global.conf->runmode == RUNMODE_INETD || global.conf->runmode == RUNMODE_FORKDAEMON ) -- cgit v1.2.3 From c84e31ae1e972a327b103ada52cae6a2e2335767 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 7 Feb 2008 21:25:18 +0000 Subject: Fixed getnameinfo() calls, this fixes Solaris stability issues. Thanks to Logan O'Sullivan Bruns for the report. --- irc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'irc.c') diff --git a/irc.c b/irc.c index 2510e3d9..3a09f684 100644 --- a/irc.c +++ b/irc.c @@ -73,7 +73,7 @@ irc_t *irc_new( int fd ) char buf[NI_MAXHOST+1]; if( getnameinfo( (struct sockaddr *) &sock, socklen, buf, - NI_MAXHOST, NULL, -1, 0 ) == 0 ) + NI_MAXHOST, NULL, 0, 0 ) == 0 ) { irc->myhost = g_strdup( ipv6_unwrap( buf ) ); } @@ -84,7 +84,7 @@ irc_t *irc_new( int fd ) char buf[NI_MAXHOST+1]; if( getnameinfo( (struct sockaddr *)&sock, socklen, buf, - NI_MAXHOST, NULL, -1, 0 ) == 0 ) + NI_MAXHOST, NULL, 0, 0 ) == 0 ) { irc->host = g_strdup( ipv6_unwrap( buf ) ); } -- cgit v1.2.3