diff options
author | Yang Tse <yangsita@gmail.com> | 2011-09-01 17:09:46 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-09-01 17:09:46 +0200 |
commit | f2285a6d399a63fd324bb8c3e90cc4655ef803be (patch) | |
tree | cdcaa7911c62c38b55bc5f53c463c2fc89f6a08d /lib/hostip.c | |
parent | fdf157abdfd8112b2454bfad7dfd57bb386966c5 (diff) | |
download | curl-f2285a6d399a63fd324bb8c3e90cc4655ef803be.tar.gz |
hostip.c: return immediately from Curl_resolv_timeout() upon expired timeout.
Ensure existing logic in Curl_resolv_timeout() is not subverted upon getting a
negative timeout from resolve_server(). The timeout in resolve_server() could
be checked to avoid calling Curl_resolv_timeout() with an expired timeout, but
fixing this in this way allows existing logic in resolve_server() to be kept
unchanged.
Diffstat (limited to 'lib/hostip.c')
-rw-r--r-- | lib/hostip.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/hostip.c b/lib/hostip.c index e857dced4..d261a163a 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -554,6 +554,10 @@ int Curl_resolv_timeout(struct connectdata *conn, *entry = NULL; + if(timeoutms < 0) + /* got an already expired timeout */ + return CURLRESOLV_TIMEDOUT; + #ifdef USE_ALARM_TIMEOUT if(data->set.no_signal) /* Ignore the timeout when signals are disabled */ |