diff options
author | Steinar H. Gunderson <sesse@google.com> | 2007-09-29 14:25:14 +0000 |
---|---|---|
committer | Steinar H. Gunderson <sesse@google.com> | 2007-09-29 14:25:14 +0000 |
commit | 13d4d28e1126538b7720a0333f7ff28a7c115d28 (patch) | |
tree | c6dd078041fac7f2584f398fef282368d9ef7f21 /ares_process.c | |
parent | 21feec7d2d707768c239a4039f89b8e795d11718 (diff) | |
download | c-ares-13d4d28e1126538b7720a0333f7ff28a7c115d28.tar.gz c-ares-13d4d28e1126538b7720a0333f7ff28a7c115d28.tar.bz2 c-ares-13d4d28e1126538b7720a0333f7ff28a7c115d28.zip |
TCP queries can time out too, not just UDP queries. (Patch from the Google tree.)
Diffstat (limited to 'ares_process.c')
-rw-r--r-- | ares_process.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ares_process.c b/ares_process.c index 9e03e40..2171011 100644 --- a/ares_process.c +++ b/ares_process.c @@ -634,7 +634,6 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now) server->qhead = sendreq; } server->qtail = sendreq; - query->timeout = 0; query->server_info[query->server].tcp_connection_generation = server->tcp_connection_generation; } @@ -656,10 +655,10 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now) next_server(channel, query, now); return; } - query->timeout = now - + ((query->try == 0) ? channel->timeout - : channel->timeout << query->try / channel->nservers); } + query->timeout = now + + ((query->try == 0) ? channel->timeout + : channel->timeout << query->try / channel->nservers); } /* |