cURL / Mailing Lists / curl-library / Single Mail


ares_getsock() return value

From: Gisle Vanem <>
Date: Fri, 11 Jan 2013 13:54:45 +0100

I'm not sure it matters, but the comment in asyn-ares.c is

 * Returns: CURLE_OK always!
int Curl_resolver_getsock(struct connectdata *conn,
                          curl_socket_t *socks,
                          int numsocks)

  int max = ares_getsock((ares_channel)conn->data->state.resolver,
                         (ares_socket_t *)socks, numsocks);

  return max;

Here 'max' is a bitmap of readable (or writable) sockets AFAICS.
And multi_getsock() seems to handle this correctly. Except maybe for
16-bit systems, DOS. The bitmap is an 'unsigned int' in multi.c !?

BTW. C-ares handles max 16 sockets here, but multi.c handles
"only" 2 * MAX_SOCKSPEREASYHANDLE==10. A little too conservative?

List admin:
Received on 2013-01-11