From 6eca2eb9a06d0991fa0f431839e528177313566a Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 18 Apr 2011 16:14:08 +0200 Subject: Try to show better Twitter error messages. Sadly this doesn't always work since Twitter can't seem to make up their mind on the formatting of their error responses, sometimes using XML and sometimes plain text. --- protocols/twitter/twitter_lib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'protocols/twitter/twitter_lib.c') diff --git a/protocols/twitter/twitter_lib.c b/protocols/twitter/twitter_lib.c index e8fb3530..472ce944 100644 --- a/protocols/twitter/twitter_lib.c +++ b/protocols/twitter/twitter_lib.c @@ -141,7 +141,7 @@ static void twitter_add_buddy(struct im_connection *ic, char *name, const char * /* Warning: May return a malloc()ed value, which will be free()d on the next call. Only for short-term use. */ -static char *twitter_parse_error(struct http_request *req) +char *twitter_parse_error(struct http_request *req) { static char *ret = NULL; struct xt_parser *xp = NULL; @@ -160,14 +160,12 @@ static char *twitter_parse_error(struct http_request *req) node->text_len > 0) { ret = g_strdup_printf("%s (%s)", req->status_string, node->text); - xt_free(xp); - return ret; } xt_free(xp); } - return req->status_string; + return ret ? ret : req->status_string; } static void twitter_http_get_friends_ids(struct http_request *req); -- cgit v1.2.3