From 936ded65a76dac7a7af56ef3f1ad6c84a32270c6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 25 May 2006 10:57:31 +0200 Subject: Disabling chat charset stuff again for now and fixed the crash-bug. Unfortunately I can't figure out how to generate chat names that don't break old BitlBees. --- protocols/oscar/chat.c | 2 ++ protocols/oscar/oscar.c | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols') diff --git a/protocols/oscar/chat.c b/protocols/oscar/chat.c index 8843b499..df535c4f 100644 --- a/protocols/oscar/chat.c +++ b/protocols/oscar/chat.c @@ -162,6 +162,7 @@ int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const /* [WvG] This wasn't there originally, but we really should send the right charset flags, as we also do with normal messages. Hope this will work. :-) */ + /* if (flags & AIM_CHATFLAGS_UNICODE) aimbs_put16(&fr->data, 0x0002); else if (flags & AIM_CHATFLAGS_ISO_8859_1) @@ -170,6 +171,7 @@ int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, guint16 flags, const aimbs_put16(&fr->data, 0x0000); aimbs_put16(&fr->data, 0x0000); + */ /* * SubTLV: Type 1: Message diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 5174f95c..c2716c6b 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -137,9 +137,9 @@ static char *extract_name(const char *name) { char *tmp; int i, j; char *x = strchr(name, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); x = strchr(++x, '-'); - if (!x) return NULL; + if (!x) return g_strdup(name); tmp = g_strdup(++x); for (i = 0, j = 0; x[i]; i++) { @@ -2606,9 +2606,9 @@ int oscar_chat_open(struct gaim_connection * gc, char *who) struct oscar_data * od = (struct oscar_data *)gc->proto_data; int ret; static int chat_id = 0; - char * chatname = g_new0(char, strlen(gc->username)+4); + char * chatname; - g_snprintf(chatname, strlen(gc->username) + 4, "%s%d", gc->username, chat_id++); + chatname = g_strdup_printf("%s%d", gc->username, chat_id++); ret = oscar_chat_join(gc, chatname); -- cgit v1.2.3 From 0602496cb6cedc917abbd0a12468e9329c6967e1 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Thu, 25 May 2006 13:22:06 +0200 Subject: Better handling of completely empty HTTP replies in http_client.c. --- protocols/http_client.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protocols') diff --git a/protocols/http_client.c b/protocols/http_client.c index 5db31782..e181438c 100644 --- a/protocols/http_client.c +++ b/protocols/http_client.c @@ -239,6 +239,11 @@ static void http_incoming_data( gpointer data, int source, GaimInputCondition co return; got_reply: + /* Maybe if the webserver is overloaded, or when there's bad SSL + support... */ + if( req->bytes_read == 0 ) + goto cleanup; + /* Zero termination is very convenient. */ req->reply_headers[req->bytes_read] = 0; -- cgit v1.2.3 From 7bfd574a6dc85b365f4a7a397ad5ca681faeb0e4 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 26 May 2006 10:57:36 +0200 Subject: Fixed a NULL pointer dereference that showed up on testing.b.o sometimes. --- protocols/oscar/im.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocols') diff --git a/protocols/oscar/im.c b/protocols/oscar/im.c index c829d409..7cccabc7 100644 --- a/protocols/oscar/im.c +++ b/protocols/oscar/im.c @@ -1468,7 +1468,7 @@ static void incomingim_ch2_icqserverrelay(aim_session_t *sess, aim_module_t *mod case AIM_MTYPE_AUTOFFC: case 0x9c: /* ICQ 5 seems to send this */ aim_send_im_ch2_statusmessage(sess, userinfo->sn, args->cookie, - gc->away, sess->aim_icq_state, dc); + gc->away ? gc->away : "", sess->aim_icq_state, dc); break; } -- cgit v1.2.3 From 60487448f3d0f3f7bb4710716e0ee257ee2edf16 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 26 May 2006 15:06:20 +0200 Subject: Added SB_FATAL to MSN errorcode 911 so BitlBee won't disconnect from MSN completely when a switchboard connection sends that error code. --- protocols/msn/sb.c | 10 ++++++---- protocols/msn/tables.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'protocols') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 234be1d6..34b0a30a 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -522,14 +522,14 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts ) if( err->flags & STATUS_SB_FATAL ) { msn_sb_destroy( sb ); - return( 0 ); + return 0; } - if( err->flags & STATUS_FATAL ) + else if( err->flags & STATUS_FATAL ) { signoff( gc ); - return( 0 ); + return 0; } - if( err->flags & STATUS_SB_IM_SPARE ) + else if( err->flags & STATUS_SB_IM_SPARE ) { if( sb->who ) { @@ -552,6 +552,8 @@ static int msn_sb_command( gpointer data, char **cmd, int num_parts ) g_slist_free( sb->msgq ); sb->msgq = NULL; } + + /* Do NOT return 0 here, we want to keep this sb. */ } } else diff --git a/protocols/msn/tables.c b/protocols/msn/tables.c index f8e98350..5ba9ea73 100644 --- a/protocols/msn/tables.c +++ b/protocols/msn/tables.c @@ -126,7 +126,7 @@ const struct msn_status_code msn_status_code_list[] = { 800, "Changing too rapidly", 0 }, { 910, "Server is busy", STATUS_FATAL }, - { 911, "Authentication failed", STATUS_FATAL }, + { 911, "Authentication failed", STATUS_SB_FATAL | STATUS_FATAL }, { 912, "Server is busy", STATUS_FATAL }, { 913, "Not allowed when hiding", 0 }, { 914, "Server is unavailable", STATUS_FATAL }, -- cgit v1.2.3