How to match the async result? (dns_submit_a4 returns 0 instead of a pointer)

Iñaki Baz Castillo ibc at aliax.net
Sat Feb 5 19:06:09 MSK 2011


2011/2/5 Iñaki Baz Castillo <ibc at aliax.net>:
> First of all, in my case dns_submit_a4() returns 0:
>
> ---------------
>  size_t query_ptr;
>
>  if (query_ptr = dns_submit_a4(dns_context, "google.com", 0,
> dns_res_A_cb, NULL) == 0) {
>    fprintf(stderr, "FATAL: unable to submit query: %s\n",
> dns_strerror(dns_status(0)));
>    return 1;
>  }
>  printf("query_ptr = <%lu>\n", (unsigned long)query_ptr);
> --------------
>
> Running it I get: "query_ptr = <0>". Shouldn't it be a pointer?

Well, dns_submit_a4() returns NULL rather than 0 sorry. But why does
it return NULL? by inspecting the code it should be dou to an error
somewhere, but the fact is that the async queries does work.





-- 
Iñaki Baz Castillo
<ibc at aliax.net>


More information about the udns mailing list