Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/pidgin-opensteamworks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2014-11-17 00:02:08 +0300
committereionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2014-11-17 00:02:08 +0300
commit4ca304e3e4a803773a5cbc9245531c0e4278fcaf (patch)
treea9fb1b7f57235fabe6304632c3f5595ba7d10cb1
parent5854f94ad9fc7598ad662e683989a7fa306e638f (diff)
Report HTTP error message if we get an error during login
-rw-r--r--steam-mobile/libsteam.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index b2da4c5..97e9a89 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -1014,11 +1014,18 @@ steam_login_with_access_token_error_cb(SteamAccount *sa, const gchar *data, gssi
steam_get_rsa_key(sa);
} else {
xmlnode *error_response = xmlnode_from_str(data, data_len);
- xmlnode *title = xmlnode_get_child(error_response, "title");
- gchar *title_str = xmlnode_get_data_unescaped(title);
- purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, title_str);
- g_free(title_str);
- xmlnode_free(error_response);
+ if (error_response != NULL) {
+ xmlnode *title = xmlnode_get_child(error_response, "title");
+ gchar *title_str = xmlnode_get_data_unescaped(title);
+ purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, title_str);
+ g_free(title_str);
+ xmlnode_free(error_response);
+ } else {
+ purple_debug_error("steam", "Access token login error: %s\n", data);
+ gchar *http_error = g_strndup(data, strchr(data, '\n') - data);
+ purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, http_error);
+ g_free(http_error);
+ }
}
}