- Timestamp:
- 2012-09-22T12:47:55Z (12 years ago)
- Branches:
- master
- Children:
- 6bef211
- Parents:
- c6fc24a (diff), 11ec078 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- protocols
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/ns.c
rc6fc24a r9c77fbf 740 740 char *psm_text = NULL; 741 741 742 ubx = xt_from_string( msg );742 ubx = xt_from_string( msg, msglen ); 743 743 if( ubx && strcmp( ubx->name, "Data" ) == 0 && 744 744 ( psm = xt_find_node( ubx->children, "PSM" ) ) ) … … 752 752 struct xt_node *adl, *d, *c; 753 753 754 if( !( adl = xt_from_string( msg ) ) )754 if( !( adl = xt_from_string( msg, msglen ) ) ) 755 755 return 1; 756 756 -
protocols/msn/soap.c
rc6fc24a r9c77fbf 229 229 if( payload ) 230 230 { 231 struct xt_node *xt = xt_from_string( payload );231 struct xt_node *xt = xt_from_string( payload, 0 ); 232 232 if( xt ) 233 233 xt_print( xt ); -
protocols/twitter/twitter_lib.c
rc6fc24a r9c77fbf 168 168 { 169 169 static char *ret = NULL; 170 struct xt_parser *xp = NULL; 171 struct xt_node *node, *err; 170 struct xt_node *root, *node, *err; 172 171 173 172 g_free(ret); … … 175 174 176 175 if (req->body_size > 0) { 177 xp = xt_new(NULL, NULL); 178 xt_feed(xp, req->reply_body, req->body_size); 176 root = xt_from_string(req->reply_body, req->body_size); 179 177 180 for (node = xp->root; node; node = node->next)178 for (node = root; node; node = node->next) 181 179 if ((err = xt_find_node(node->children, "error")) && err->text_len > 0) { 182 180 ret = g_strdup_printf("%s (%s)", req->status_string, err->text); … … 184 182 } 185 183 186 xt_free (xp);184 xt_free_node(root); 187 185 } 188 186 … … 256 254 { 257 255 struct im_connection *ic; 258 struct xt_ parser *parser;256 struct xt_node *parsed; 259 257 struct twitter_xml_list *txl; 260 258 struct twitter_data *td; … … 292 290 293 291 // Parse the data. 294 parser = xt_new(NULL, txl); 295 xt_feed(parser, req->reply_body, req->body_size); 296 twitter_xt_get_friends_id_list(parser->root, txl); 297 xt_free(parser); 292 parsed = xt_from_string(req->reply_body, req->body_size); 293 twitter_xt_get_friends_id_list(parsed, txl); 294 xt_free_node(parsed); 298 295 299 296 td->follow_ids = txl->list; … … 352 349 struct im_connection *ic = req->data; 353 350 struct twitter_data *td; 354 struct xt_ parser *parser;351 struct xt_node *parsed; 355 352 struct twitter_xml_list *txl; 356 353 GSList *l = NULL; … … 377 374 378 375 // Parse the data. 379 parser = xt_new(NULL, txl); 380 xt_feed(parser, req->reply_body, req->body_size); 376 parsed = xt_from_string(req->reply_body, req->body_size); 381 377 382 378 // Get the user list from the parsed xml feed. 383 twitter_xt_get_users(parse r->root, txl);384 xt_free (parser);379 twitter_xt_get_users(parsed, txl); 380 xt_free_node(parsed); 385 381 386 382 // Add the users as buddies. … … 739 735 740 736 if (td->flags & TWITTER_DOING_TIMELINE) { 741 return; 737 if (++td->http_fails >= 5) { 738 imcb_error(ic, "Fetch timeout (%d)", td->flags); 739 imc_logout(ic, TRUE); 740 } 742 741 } 743 742 … … 886 885 struct im_connection *ic = req->data; 887 886 struct twitter_data *td; 888 struct xt_ parser *parser;887 struct xt_node *parsed; 889 888 struct twitter_xml_list *txl; 890 889 … … 913 912 914 913 // Parse the data. 915 parser = xt_new(NULL, txl); 916 xt_feed(parser, req->reply_body, req->body_size); 914 parsed = xt_from_string(req->reply_body, req->body_size); 917 915 // The root <statuses> node should hold the list of statuses <status> 918 twitter_xt_get_status_list(ic, parse r->root, txl);919 xt_free (parser);916 twitter_xt_get_status_list(ic, parsed, txl); 917 xt_free_node(parsed); 920 918 921 919 td->home_timeline_obj = txl; … … 934 932 struct im_connection *ic = req->data; 935 933 struct twitter_data *td; 936 struct xt_ parser *parser;934 struct xt_node *parsed; 937 935 struct twitter_xml_list *txl; 938 936 … … 961 959 962 960 // Parse the data. 963 parser = xt_new(NULL, txl); 964 xt_feed(parser, req->reply_body, req->body_size); 961 parsed = xt_from_string(req->reply_body, req->body_size); 965 962 // The root <statuses> node should hold the list of statuses <status> 966 twitter_xt_get_status_list(ic, parse r->root, txl);967 xt_free (parser);963 twitter_xt_get_status_list(ic, parsed, txl); 964 xt_free_node(parsed); 968 965 969 966 td->mentions_obj = txl; … … 999 996 1000 997 if (req->body_size > 0) { 1001 struct xt_parser *xp = NULL; 1002 struct xt_node *node; 1003 1004 xp = xt_new(NULL, NULL); 1005 xt_feed(xp, req->reply_body, req->body_size); 1006 1007 if ((node = xt_find_node(xp->root, "status")) && 998 struct xt_node *parsed, *node; 999 1000 parsed = xt_from_string(req->reply_body, req->body_size); 1001 1002 if ((node = xt_find_node(parsed, "status")) && 1008 1003 (node = xt_find_node(node->children, "id")) && node->text) 1009 1004 td->last_status_id = g_ascii_strtoull(node->text, NULL, 10); 1010 1005 1011 xt_free (xp);1006 xt_free_node(parsed); 1012 1007 } 1013 1008 }
Note: See TracChangeset
for help on using the changeset viewer.