- Timestamp:
- 2010-05-23T14:52:41Z (15 years ago)
- Branches:
- master
- Children:
- ba3233c
- Parents:
- 228fc18
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r228fc18 r3d93aed 122 122 { 123 123 static char *ret = NULL; 124 struct xt_parser *xp ;124 struct xt_parser *xp = NULL; 125 125 struct xt_node *node; 126 char *err_s = NULL;127 126 128 127 g_free(ret); 129 128 ret = NULL; 130 129 131 xp = xt_new(NULL, NULL); 132 xt_feed(xp, req->reply_body, req->body_size); 133 134 if ((node = xt_find_node(xp->root, "hash")) && 135 (node = xt_find_node(node->children, "error")) && 136 node->text_len > 0) 137 err_s = node->text; 138 139 if (err_s) 140 { 141 ret = g_strdup_printf("%s (%s)", req->status_string, err_s); 130 if (req->body_size > 0) 131 { 132 xp = xt_new(NULL, NULL); 133 xt_feed(xp, req->reply_body, req->body_size); 134 135 if ((node = xt_find_node(xp->root, "hash")) && 136 (node = xt_find_node(node->children, "error")) && 137 node->text_len > 0) 138 { 139 ret = g_strdup_printf("%s (%s)", req->status_string, node->text); 140 xt_free(xp); 141 return ret; 142 } 143 142 144 xt_free(xp); 143 return ret; 144 } 145 else 146 { 147 return req->status_string; 148 } 145 } 146 147 return req->status_string; 149 148 } 150 149
Note: See TracChangeset
for help on using the changeset viewer.