--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Dec 18 19:18:18 2015 -0600
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Fri Dec 18 22:02:55 2015 -0600
@@ -23,7 +23,6 @@
/* TODO: it needs further refactoring */
@@ -39,6 +38,8 @@
#include "yahoo_doodle.h"
#include "yahoo_friend.h"
@@ -498,14 +499,15 @@
-static void yahoo_xfer_dns_connected_15(GSList *hosts, gpointer data, const char *error_message)
+yahoo_xfer_dns_connected_15(GObject *sender, GAsyncResult *result, gpointer data) + GList *addresses = NULL; + GInetAddress *inet_address = NULL; struct yahoo_xfer_data *xd;
- struct sockaddr_in *addr;
struct yahoo_packet *pkt;
@@ -519,47 +521,22 @@
account = purple_connection_get_account(gc);
yd = purple_connection_get_protocol_data(gc);
- purple_debug_error("yahoo", "Unable to find an IP address for relay.msg.yahoo.com\n");
- purple_xfer_cancel_remote(xfer);
+ addresses = g_resolver_lookup_by_name_finish(g_resolver_get_default(), result, &error); + purple_debug_error("yahoo", + "Unable to find an IP address for relay.msg.yahoo.com : %s\n", - /* Discard the length... */
- hosts = g_slist_remove(hosts, hosts->data);
- purple_debug_error("yahoo", "Unable to find an IP address for relay.msg.yahoo.com\n");
purple_xfer_cancel_remote(xfer);
- /* TODO:actually, u must try with addr no.1 , if its not working addr no.2 ..... */
- actaddr = addr->sin_addr.s_addr;
- xd->host = g_strdup_printf("%u.%u.%u.%u", d, c, b, a);
+ inet_address = G_INET_ADDRESS(addresses->data); + xd->host = g_inet_address_to_string(inet_address); - /* Free the address... */
- hosts = g_slist_remove(hosts, hosts->data);
- /* Discard the length... */
- hosts = g_slist_remove(hosts, hosts->data);
- /* Free the address... */
- hosts = g_slist_remove(hosts, hosts->data);
+ g_resolver_free_addresses(addresses); pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANS_INFO_15, YAHOO_STATUS_AVAILABLE, yd->session_id);
filename = g_path_get_basename(purple_xfer_get_local_filename(xfer));
@@ -700,7 +677,6 @@
- PurpleAccount *account;
struct yahoo_xfer_data *xd;
xfer = g_hash_table_lookup(yd->xfer_peer_idstring_map,
@@ -726,10 +702,12 @@
- account = purple_connection_get_account(gc);
- purple_dnsquery_a(account, YAHOO_XFER_RELAY_HOST,
- yahoo_xfer_dns_connected_15, xfer);
+ g_resolver_lookup_by_name_async(g_resolver_get_default(), + yahoo_xfer_dns_connected_15,