aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-09-01 16:47:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-09-01 16:47:42 +0200
commit5e920157112923417faf901b08098b65d82f7746 (patch)
tree1c8942dbf075c59799d37a856729f83e7bfd2d18 /lib
parentce00c2ef5d5b25b045ed630c72628e8a05f51943 (diff)
threaded resolver: no more expire 0 calls
Curl_expire() set to 0 expires ALL timeouts so it should only be called if we truly and really want to remove all timeouts for the handle.
Diffstat (limited to 'lib')
-rw-r--r--lib/hostthre.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/hostthre.c b/lib/hostthre.c
index 8a5f67a17..e8dfa5400 100644
--- a/lib/hostthre.c
+++ b/lib/hostthre.c
@@ -419,8 +419,6 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
if (done) {
getaddrinfo_complete(conn);
- if (td->poll_interval != 0)
- Curl_expire(conn->data, 0);
Curl_destroy_thread_data(&conn->async);
if(!conn->async.dns) {
@@ -431,29 +429,21 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
*entry = conn->async.dns;
} else {
/* poll for name lookup done with exponential backoff up to 250ms */
- int elapsed;
-
- elapsed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
- if (elapsed < 0) {
+ int elapsed = Curl_tvdiff(Curl_tvnow(), data->progress.t_startsingle);
+ if (elapsed < 0)
elapsed = 0;
- }
- if (td->poll_interval == 0) {
+ if (td->poll_interval == 0)
/* Start at 1ms poll interval */
td->poll_interval = 1;
- } else if (elapsed >= td->interval_end) {
+ else if (elapsed >= td->interval_end)
/* Back-off exponentially if last interval expired */
td->poll_interval *= 2;
- }
if (td->poll_interval > 250)
td->poll_interval = 250;
td->interval_end = elapsed + td->poll_interval;
-
- /* Reset old timer so we can set a new one further in the future */
- Curl_expire(conn->data, 0);
-
Curl_expire(conn->data, td->poll_interval);
}