comparison libpurple/protocols/yahoo/libymsg.c @ 31066:63b9cb97d356

merged from im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 23 Oct 2010 16:12:36 +0900
parents c5ba7dd399fa 943fce8ef142
children fa88dc1dcabb
comparison
equal deleted inserted replaced
31041:2eacc8595967 31066:63b9cb97d356
315 char *tmp; 315 char *tmp;
316 gsize len; 316 gsize len;
317 317
318 if (pair->value) { 318 if (pair->value) {
319 decoded = purple_base64_decode(pair->value, &len); 319 decoded = purple_base64_decode(pair->value, &len);
320 if (len) { 320 if (decoded && len > 0) {
321 tmp = purple_str_binary_to_ascii(decoded, len); 321 tmp = purple_str_binary_to_ascii(decoded, len);
322 purple_debug_info("yahoo", "Got key 197, value = %s\n", tmp); 322 purple_debug_info("yahoo", "Got key 197, value = %s\n", tmp);
323 g_free(tmp); 323 g_free(tmp);
324 } 324 }
325 g_free(decoded); 325 g_free(decoded);
2867 } 2867 }
2868 2868
2869 if (base64) { 2869 if (base64) {
2870 guint32 ip; 2870 guint32 ip;
2871 YahooFriend *f; 2871 YahooFriend *f;
2872 char *host_ip; 2872 char *host_ip, *tmp;
2873 struct yahoo_p2p_data *p2p_data; 2873 struct yahoo_p2p_data *p2p_data;
2874 2874
2875 decoded = purple_base64_decode(base64, &len); 2875 decoded = purple_base64_decode(base64, &len);
2876 if (len) { 2876 if (decoded == NULL) {
2877 char *tmp = purple_str_binary_to_ascii(decoded, len); 2877 purple_debug_info("yahoo","p2p: Unable to decode base64 IP (%s) \n", base64);
2878 purple_debug_info("yahoo", "Got P2P service packet (from server): who = %s, ip = %s\n", who, tmp); 2878 return;
2879 g_free(tmp); 2879 }
2880 } 2880 tmp = purple_str_binary_to_ascii(decoded, len);
2881 purple_debug_info("yahoo", "Got P2P service packet (from server): who = %s, ip = %s\n", who, tmp);
2882 g_free(tmp);
2881 2883
2882 ip = strtol((gchar *)decoded, NULL, 10); 2884 ip = strtol((gchar *)decoded, NULL, 10);
2883 g_free(decoded); 2885 g_free(decoded);
2884 host_ip = g_strdup_printf("%u.%u.%u.%u", ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff, 2886 host_ip = g_strdup_printf("%u.%u.%u.%u", ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff,
2885 (ip >> 24) & 0xff); 2887 (ip >> 24) & 0xff);