im.pidgin.cpw.resiak.disconnectreason: b7cccbf3d88850c3dcf378f41a25883ceb9cbc5c
resiak at soc.pidgin.im
resiak at soc.pidgin.im
Fri Oct 5 15:00:59 EDT 2007
revision: b7cccbf3d88850c3dcf378f41a25883ceb9cbc5c
date: 2007-10-05T18:33:27
author: resiak at soc.pidgin.im
branch: im.pidgin.cpw.resiak.disconnectreason
changelog:
Sprinkle gc->wants_to_die = TRUE liberally around connection errors that really
ought to have been setting it already so that it is always set when a
disconnection reason is fatal. In a couple of other places, fix the reason to
be more accurate and not be fatal.
manifest:
format_version "1"
new_manifest [e24e323d52ecae35ad49c4d2c7c24240adb86694]
old_revision [23e3bb1fa83c5dc2bbfd9a8e397c2a5c6bc4e305]
patch "libpurple/protocols/irc/irc.c"
from [26586b79c4a0992ef6e717d0b5e18f5fc930c43c]
to [b30234a4c65dda67d1d13c0263cbb2a74eb733a2]
patch "libpurple/protocols/irc/parse.c"
from [e8b34e334a19e2056a9814208d697d541f3420f3]
to [f5b214757d17f0e9226bf662b69ede22bd3d6205]
patch "libpurple/protocols/jabber/auth.c"
from [039ac272182a35ab037a558b3dda72e9c1caa3ed]
to [077140bf57ab00f66420ed2f86a94e44ecbce989]
patch "libpurple/protocols/jabber/jabber.c"
from [d6697f57fe5a70c9d184083e364d3ca374e6a217]
to [76eaf130727587766feb9017e6636db633f6d195]
patch "libpurple/protocols/jabber/parser.c"
from [e10abdfaf92499f8e3b23d4375f9b8fcfb5c8de8]
to [e12928b8fdf047088be6c8f147b92a06ecaaed67]
patch "libpurple/protocols/novell/novell.c"
from [e7914b46963e2ce8dc507816d060df03c45cd665]
to [488f636599bd8dba8d548590c443a0416eee830f]
patch "libpurple/protocols/oscar/oscar.c"
from [0fe441d76d29a3b41e2ae066d153dba4f14d59cd]
to [c2ad4adde2cf631f07b4facf632d25678a66f1f0]
patch "libpurple/protocols/sametime/sametime.c"
from [f867b61b61782545fabd4258f80160e10f3fa51c]
to [74a86017c333ebbd8f17a7e5d425551d1fcf9524]
patch "libpurple/protocols/silc/silc.c"
from [e5a0e121aa4380f573b2648d695505dd2ea891a4]
to [a62bcac2f60edc43aceec8343bc1458f2abf0957]
-------------- next part --------------
============================================================
--- libpurple/protocols/irc/irc.c 26586b79c4a0992ef6e717d0b5e18f5fc930c43c
+++ libpurple/protocols/irc/irc.c b30234a4c65dda67d1d13c0263cbb2a74eb733a2
@@ -297,6 +297,7 @@ static void irc_login(PurpleAccount *acc
gc->flags |= PURPLE_CONNECTION_NO_NEWLINES;
if (strpbrk(username, " \t\v\r\n") != NULL) {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
_("IRC nicks may not contain whitespace"));
return;
@@ -327,6 +328,7 @@ static void irc_login(PurpleAccount *acc
purple_account_get_int(account, "port", IRC_DEFAULT_SSL_PORT),
irc_login_cb_ssl, irc_ssl_connect_failure, gc);
} else {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("SSL support unavailable"));
return;
============================================================
--- libpurple/protocols/irc/parse.c e8b34e334a19e2056a9814208d697d541f3420f3
+++ libpurple/protocols/irc/parse.c f5b214757d17f0e9226bf662b69ede22bd3d6205
@@ -576,11 +576,11 @@ void irc_parse_msg(struct irc_conn *irc,
} else if (!strncmp(input, "ERROR ", 6)) {
if (g_utf8_validate(input, -1, NULL)) {
char *tmp = g_strdup_printf("%s\n%s", _("Disconnected."), input);
- purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR, tmp);
+ purple_connection_error_reason (gc, PURPLE_REASON_NETWORK_ERROR, tmp);
g_free(tmp);
} else
purple_connection_error_reason (gc,
- PURPLE_REASON_OTHER_ERROR, _("Disconnected."));
+ PURPLE_REASON_NETWORK_ERROR, _("Disconnected."));
return;
}
============================================================
--- libpurple/protocols/jabber/auth.c 039ac272182a35ab037a558b3dda72e9c1caa3ed
+++ libpurple/protocols/jabber/auth.c 077140bf57ab00f66420ed2f86a94e44ecbce989
@@ -50,6 +50,7 @@ jabber_process_starttls(JabberStream *js
"<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1);
return TRUE;
} else if(xmlnode_get_child(starttls, "required")) {
+ js->gc->wants_to_die = TRUE;
purple_connection_error_reason (js->gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("Server requires TLS/SSL for login. No TLS/SSL support found."));
return TRUE;
@@ -114,6 +115,7 @@ static void disallow_plaintext_auth(Purp
static void disallow_plaintext_auth(PurpleAccount *account)
{
+ account->gc->wants_to_die = TRUE;
purple_connection_error_reason (account->gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("Server requires plaintext authentication over an unencrypted stream"));
}
@@ -542,17 +544,19 @@ static void auth_old_result_cb(JabberStr
char *msg = jabber_parse_error(js, packet);
xmlnode *error;
const char *err_code;
+ PurpleDisconnectReason reason = PURPLE_REASON_NETWORK_ERROR;
if((error = xmlnode_get_child(packet, "error")) &&
(err_code = xmlnode_get_attrib(error, "code")) &&
!strcmp(err_code, "401")) {
js->gc->wants_to_die = TRUE;
+ reason = PURPLE_REASON_AUTHENTICATION_FAILED;
/* Clear the pasword if it isn't being saved */
if (!purple_account_get_remember_password(js->gc->account))
purple_account_set_password(js->gc->account, NULL);
}
- purple_connection_error_reason (js->gc, PURPLE_REASON_OTHER_ERROR, msg);
+ purple_connection_error_reason (js->gc, reason, msg);
g_free(msg);
}
}
@@ -570,7 +574,7 @@ static void auth_old_cb(JabberStream *js
return;
} else if(!strcmp(type, "error")) {
char *msg = jabber_parse_error(js, packet);
- purple_connection_error_reason (js->gc, PURPLE_REASON_AUTHENTICATION_FAILED,
+ purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
msg);
g_free(msg);
} else if(!strcmp(type, "result")) {
@@ -977,7 +981,7 @@ void jabber_auth_handle_failure(JabberSt
purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
_("Invalid response from server."));
} else {
- purple_connection_error_reason (js->gc, PURPLE_REASON_AUTHENTICATION_FAILED,
+ purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
msg);
g_free(msg);
}
============================================================
--- libpurple/protocols/jabber/jabber.c d6697f57fe5a70c9d184083e364d3ca374e6a217
+++ libpurple/protocols/jabber/jabber.c 76eaf130727587766feb9017e6636db633f6d195
@@ -588,12 +588,14 @@ jabber_login(PurpleAccount *account)
js->old_length = -1;
if(!js->user) {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
_("Invalid XMPP ID"));
return;
}
if (!js->user->domain || *(js->user->domain) == '\0') {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
_("Invalid XMPP ID. Domain must be set."));
return;
@@ -625,6 +627,7 @@ jabber_login(PurpleAccount *account)
purple_account_get_int(account, "port", 5223), jabber_login_callback_ssl,
jabber_ssl_connect_failure, js->gc);
} else {
+ js->gc->wants_to_die = TRUE;
purple_connection_error_reason (js->gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("SSL support unavailable"));
}
@@ -1079,6 +1082,7 @@ void jabber_register_account(PurpleAccou
js->old_length = -1;
if(!js->user) {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
_("Invalid XMPP ID"));
return;
@@ -1112,6 +1116,7 @@ void jabber_register_account(PurpleAccou
purple_account_get_int(account, "port", 5222),
jabber_login_callback_ssl, jabber_ssl_connect_failure, gc);
} else {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("SSL support unavailable"));
}
============================================================
--- libpurple/protocols/jabber/parser.c e10abdfaf92499f8e3b23d4375f9b8fcfb5c8de8
+++ libpurple/protocols/jabber/parser.c e12928b8fdf047088be6c8f147b92a06ecaaed67
@@ -193,7 +193,7 @@ void jabber_parser_process(JabberStream
js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
xmlParseChunk(js->context, "", 0, 0);
} else if (xmlParseChunk(js->context, buf, len, 0) < 0) {
- purple_connection_error_reason (js->gc, PURPLE_REASON_OTHER_ERROR,
+ purple_connection_error_reason (js->gc, PURPLE_REASON_NETWORK_ERROR,
_("XML Parse error"));
}
}
============================================================
--- libpurple/protocols/novell/novell.c e7914b46963e2ce8dc507816d060df03c45cd665
+++ libpurple/protocols/novell/novell.c 488f636599bd8dba8d548590c443a0416eee830f
@@ -2178,7 +2178,8 @@ novell_login(PurpleAccount * account)
*/
/* ...but for now just error out with a nice message. */
- purple_connection_error_reason (gc, PURPLE_REASON_OTHER_ERROR,
+ gc->wants_to_die = TRUE;
+ purple_connection_error_reason (gc, PURPLE_REASON_INVALID_SETTINGS,
_("Unable to connect to server. Please enter the "
"address of the server you wish to connect to."));
return;
@@ -2206,6 +2207,7 @@ novell_login(PurpleAccount * account)
user->conn->addr, user->conn->port,
novell_ssl_connected_cb, novell_ssl_connect_error, gc);
if (user->conn->ssl_conn->data == NULL) {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason (gc,
PURPLE_REASON_ENCRYPTION_ERROR,
_("Error. SSL support is not installed."));
============================================================
--- libpurple/protocols/oscar/oscar.c 0fe441d76d29a3b41e2ae066d153dba4f14d59cd
+++ libpurple/protocols/oscar/oscar.c c2ad4adde2cf631f07b4facf632d25678a66f1f0
@@ -1259,7 +1259,7 @@ oscar_login(PurpleAccount *account)
gchar *buf;
buf = g_strdup_printf(_("Unable to login: Could not sign on as %s because the screen name is invalid. Screen names must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), purple_account_get_username(account));
gc->wants_to_die = TRUE;
- purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, buf);
+ purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, buf);
g_free(buf);
}
@@ -1378,7 +1378,8 @@ purple_parse_auth_resp(OscarData *od, Fl
purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
break;
default:
- purple_connection_error_reason(gc, PURPLE_REASON_NETWORK_ERROR, _("Authentication failed"));
+ gc->wants_to_die = TRUE;
+ purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED, _("Authentication failed"));
break;
}
purple_debug_info("oscar", "Login Error Code 0x%04hx\n", info->errorcode);
============================================================
--- libpurple/protocols/sametime/sametime.c f867b61b61782545fabd4258f80160e10f3fa51c
+++ libpurple/protocols/sametime/sametime.c 74a86017c333ebbd8f17a7e5d425551d1fcf9524
@@ -1563,12 +1563,14 @@ static void mw_session_stateChange(struc
case INCORRECT_LOGIN:
case USER_UNREGISTERED:
case GUEST_IN_USE:
+ gc->wants_to_die = TRUE;
reason = PURPLE_REASON_AUTHENTICATION_FAILED;
break;
case ENCRYPT_MISMATCH:
case ERR_ENCRYPT_NO_SUPPORT:
case ERR_NO_COMMON_ENCRYPT:
+ gc->wants_to_die = TRUE;
reason = PURPLE_REASON_ENCRYPTION_ERROR;
break;
@@ -1578,6 +1580,7 @@ static void mw_session_stateChange(struc
case MULTI_SERVER_LOGIN:
case MULTI_SERVER_LOGIN2:
+ gc->wants_to_die = TRUE;
reason = PURPLE_REASON_NAME_IN_USE;
break;
@@ -3646,6 +3649,7 @@ static void prompt_host_cancel_cb(Purple
static void prompt_host_cancel_cb(PurpleConnection *gc) {
const char *msg = _("No Sametime Community Server specified");
+ gc->wants_to_die = TRUE;
purple_connection_error_reason(gc, PURPLE_REASON_INVALID_SETTINGS, msg);
}
============================================================
--- libpurple/protocols/silc/silc.c e5a0e121aa4380f573b2648d695505dd2ea891a4
+++ libpurple/protocols/silc/silc.c a62bcac2f60edc43aceec8343bc1458f2abf0957
@@ -229,16 +229,19 @@ silcpurple_connect_cb(SilcClient client,
break;
case SILC_CLIENT_CONN_ERROR_KE:
+ gc->wants_to_die = TRUE;
purple_connection_error_reason(gc, PURPLE_REASON_ENCRYPTION_ERROR,
_("Key Exchange failed"));
break;
case SILC_CLIENT_CONN_ERROR_AUTH:
+ gc->wants_to_die = TRUE;
purple_connection_error_reason(gc, PURPLE_REASON_AUTHENTICATION_FAILED,
_("Authentication failed"));
break;
case SILC_CLIENT_CONN_ERROR_RESUME:
+ gc->wants_to_die = TRUE;
purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
_("Resuming detached session failed. "
"Press Reconnect to create new connection."));
@@ -357,6 +360,7 @@ static void silcpurple_running(SilcClien
(char *)purple_account_get_string(account, "private-key", prd),
(gc->password == NULL) ? "" : gc->password,
&sg->public_key, &sg->private_key)) {
+ gc->wants_to_die = TRUE;
purple_connection_error_reason(gc, PURPLE_REASON_OTHER_ERROR,
_("Could not load SILC key pair"));
gc->proto_data = NULL;
More information about the Commits
mailing list