diff options
author | Steinar H. Gunderson <sesse@google.com> | 2007-09-28 14:46:51 +0000 |
---|---|---|
committer | Steinar H. Gunderson <sesse@google.com> | 2007-09-28 14:46:51 +0000 |
commit | 6ce589c3ee1b905d22d419531e8e2019134e833b (patch) | |
tree | eb557ed81d38a2339ca2cb6069b8973c93f18e17 /ares/ares_send.c | |
parent | d426c20c0a71df7db7a8bae18c91034df502070a (diff) |
Make the query callbacks return the number of timeouts that happened during the execution of a query, and update documentation accordingly. (Patch from the Google tree.)
Diffstat (limited to 'ares/ares_send.c')
-rw-r--r-- | ares/ares_send.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ares/ares_send.c b/ares/ares_send.c index fd1450b4a..c8015803b 100644 --- a/ares/ares_send.c +++ b/ares/ares_send.c @@ -44,7 +44,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, /* Verify that the query is at least long enough to hold the header. */ if (qlen < HFIXEDSZ || qlen >= (1 << 16)) { - callback(arg, ARES_EBADQUERY, NULL, 0); + callback(arg, ARES_EBADQUERY, 0, NULL, 0); return; } @@ -52,14 +52,14 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, query = malloc(sizeof(struct query)); if (!query) { - callback(arg, ARES_ENOMEM, NULL, 0); + callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } query->tcpbuf = malloc(qlen + 2); if (!query->tcpbuf) { free(query); - callback(arg, ARES_ENOMEM, NULL, 0); + callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } query->server_info = malloc(channel->nservers * @@ -68,7 +68,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, { free(query->tcpbuf); free(query); - callback(arg, ARES_ENOMEM, NULL, 0); + callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } @@ -100,6 +100,7 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, } query->using_tcp = (channel->flags & ARES_FLAG_USEVC) || qlen > PACKETSZ; query->error_status = ARES_ECONNREFUSED; + query->timeouts = 0; /* Chain the query into this channel's query list. */ query->next = channel->queries; |