Mercurial > pidgin
comparison libpurple/dnsquery.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
| author | Elliott Sales de Andrade <qulogic@pidgin.im> |
|---|---|
| date | Sat, 02 Jun 2012 02:30:49 +0000 |
| parents | f22bc8b5b9dc |
| children |
comparison
equal
deleted
inserted
replaced
| 32818:01ff09d4a463 | 32819:2c6510167895 |
|---|---|
| 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 { |
