Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/clientlogin.c @ 31340:4f0d6ee5ffee
The end user is not going to be amused when he sees a "<URL>: Ok" connection
error.
author | ivan.komarov@soc.pidgin.im |
---|---|
date | Thu, 04 Nov 2010 18:28:48 +0000 |
parents | d9e21370fca0 |
children | f8f853ab3aba |
comparison
equal
deleted
inserted
replaced
31337:56e1f06471a9 | 31340:4f0d6ee5ffee |
---|---|
91 } | 91 } |
92 | 92 |
93 static gchar *generate_error_message(xmlnode *resp, const char *url) | 93 static gchar *generate_error_message(xmlnode *resp, const char *url) |
94 { | 94 { |
95 xmlnode *text; | 95 xmlnode *text; |
96 xmlnode *status_code_node; | |
97 gchar *status_code; | |
98 gboolean have_error_code = TRUE; | |
96 gchar *err = NULL; | 99 gchar *err = NULL; |
97 gchar *details = NULL; | 100 gchar *details = NULL; |
98 | 101 |
99 if (resp && (text = xmlnode_get_child(resp, "statusText"))) { | 102 status_code_node = xmlnode_get_child(resp, "statusCode"); |
103 if (status_code_node) { | |
104 /* We can get 200 OK here if the server omitted something we think it shouldn't have (see #12783). | |
105 * No point in showing the "Ok" string to the user. | |
106 */ | |
107 if ((status_code = xmlnode_get_data_unescaped(status_code_node)) && strcmp(status_code, "200") == 0) { | |
108 have_error_code = FALSE; | |
109 } | |
110 } | |
111 if (have_error_code && resp && (text = xmlnode_get_child(resp, "statusText"))) { | |
100 details = xmlnode_get_data(text); | 112 details = xmlnode_get_data(text); |
101 } | 113 } |
102 | 114 |
103 if (details && *details) { | 115 if (details && *details) { |
104 err = g_strdup_printf(_("Received unexpected response from %s: %s"), url, details); | 116 err = g_strdup_printf(_("Received unexpected response from %s: %s"), url, details); |