summaryrefslogtreecommitdiff
path: root/ares_send.c
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sesse@google.com>2007-09-28 14:46:51 +0000
committerSteinar H. Gunderson <sesse@google.com>2007-09-28 14:46:51 +0000
commit50ba81cd230f9054fa7c45cb4202ce8720c502b3 (patch)
tree277c02b995aacc09540ec58270e10cd1845ff2b3 /ares_send.c
parentb669e17544c0ff64d120b8a0df2677c59ccea8fd (diff)
downloadc-ares-50ba81cd230f9054fa7c45cb4202ce8720c502b3.tar.gz
c-ares-50ba81cd230f9054fa7c45cb4202ce8720c502b3.tar.bz2
c-ares-50ba81cd230f9054fa7c45cb4202ce8720c502b3.zip
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_send.c')
-rw-r--r--ares_send.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ares_send.c b/ares_send.c
index fd1450b..c801580 100644
--- a/ares_send.c
+++ b/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;