Mercurial > pidgin
comparison libpurple/dnsquery.c @ 32672:3828a61c44da
A boring and large patch so I can merge heads.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Fri, 23 Dec 2011 08:21:58 +0000 |
parents | 8dbe2f531a89 |
children |
comparison
equal
deleted
inserted
replaced
32671:0e69949b3e61 | 32672:3828a61c44da |
---|---|
295 printf("dns[%d]: nobody needs me... =(\n", getpid()); | 295 printf("dns[%d]: nobody needs me... =(\n", getpid()); |
296 break; | 296 break; |
297 } | 297 } |
298 rc = read(child_in, &dns_params, sizeof(dns_params_t)); | 298 rc = read(child_in, &dns_params, sizeof(dns_params_t)); |
299 if (rc < 0) { | 299 if (rc < 0) { |
300 if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) { | |
301 /* Try again */ | |
302 continue; | |
303 } | |
300 fprintf(stderr, "dns[%d]: Error: Could not read dns_params: " | 304 fprintf(stderr, "dns[%d]: Error: Could not read dns_params: " |
301 "%s\n", getpid(), strerror(errno)); | 305 "%s\n", getpid(), strerror(errno)); |
302 break; | 306 break; |
303 } | 307 } |
304 if (rc == 0) { | 308 if (rc == 0) { |
908 | 912 |
909 return FALSE; | 913 return FALSE; |
910 } | 914 } |
911 | 915 |
912 PurpleDnsQueryData * | 916 PurpleDnsQueryData * |
913 purple_dnsquery_a_account(PurpleAccount *account, const char *hostname, int port, | 917 purple_dnsquery_a(PurpleAccount *account, const char *hostname, int port, |
914 PurpleDnsQueryConnectFunction callback, gpointer data) | 918 PurpleDnsQueryConnectFunction callback, gpointer data) |
915 { | 919 { |
916 PurpleDnsQueryData *query_data; | 920 PurpleDnsQueryData *query_data; |
917 | 921 |
918 g_return_val_if_fail(hostname != NULL, NULL); | 922 g_return_val_if_fail(hostname != NULL, NULL); |
936 } | 940 } |
937 | 941 |
938 query_data->timeout = purple_timeout_add(0, initiate_resolving, query_data); | 942 query_data->timeout = purple_timeout_add(0, initiate_resolving, query_data); |
939 | 943 |
940 return query_data; | 944 return query_data; |
941 } | |
942 | |
943 PurpleDnsQueryData * | |
944 purple_dnsquery_a(const char *hostname, int port, | |
945 PurpleDnsQueryConnectFunction callback, gpointer data) | |
946 { | |
947 return purple_dnsquery_a_account(NULL, hostname, port, callback, data); | |
948 } | 945 } |
949 | 946 |
950 void | 947 void |
951 purple_dnsquery_destroy(PurpleDnsQueryData *query_data) | 948 purple_dnsquery_destroy(PurpleDnsQueryData *query_data) |
952 { | 949 { |