Skip to content

Commit

Permalink
hostip.c: return immediately from Curl_resolv_timeout() upon expired …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
yangtse committed Sep 1, 2011
1 parent fdf157a commit f2285a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/hostip.c
Expand Up @@ -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 */
Expand Down

0 comments on commit f2285a6

Please sign in to comment.