mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
The asynch name resolve methods now all use CURL_TIMEOUT_RESOLVE for
the specific time to wait for a resolve. The definition is at the top of this source file.
This commit is contained in:
parent
ea0cf7c87b
commit
d5074f74bb
16
lib/hostip.c
16
lib/hostip.c
@ -88,6 +88,9 @@
|
|||||||
#define ARES_SUCCESS CURLE_OK
|
#define ARES_SUCCESS CURLE_OK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define CURL_TIMEOUT_RESOLVE 300 /* when using asynch methods, we allow this
|
||||||
|
many seconds for a name resolve */
|
||||||
|
|
||||||
/* These two symbols are for the global DNS cache */
|
/* These two symbols are for the global DNS cache */
|
||||||
static curl_hash hostname_cache;
|
static curl_hash hostname_cache;
|
||||||
static int host_cache_initialized;
|
static int host_cache_initialized;
|
||||||
@ -570,8 +573,8 @@ CURLcode Curl_is_resolved(struct connectdata *conn,
|
|||||||
diff = Curl_tvdiff(Curl_tvnow(),
|
diff = Curl_tvdiff(Curl_tvnow(),
|
||||||
data->progress.t_startsingle)/1000;
|
data->progress.t_startsingle)/1000;
|
||||||
|
|
||||||
if(diff > 180) {
|
if(diff > CURL_TIMEOUT_RESOLVE) {
|
||||||
/* Waited >180 seconds, this is a name resolve timeout! */
|
/* Waited many seconds, this is a name resolve timeout! */
|
||||||
failf(data, "Name resolve timeout after %ld seconds", diff);
|
failf(data, "Name resolve timeout after %ld seconds", diff);
|
||||||
return CURLE_OPERATION_TIMEDOUT;
|
return CURLE_OPERATION_TIMEDOUT;
|
||||||
}
|
}
|
||||||
@ -614,7 +617,7 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
CURLcode rc=CURLE_OK;
|
CURLcode rc=CURLE_OK;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
struct timeval now = Curl_tvnow();
|
struct timeval now = Curl_tvnow();
|
||||||
long timeout = 300; /* default name resolve timeout in seconds */
|
long timeout = CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */
|
||||||
|
|
||||||
/* now, see if there's a connect timeout or a regular timeout to
|
/* now, see if there's a connect timeout or a regular timeout to
|
||||||
use instead of the default one */
|
use instead of the default one */
|
||||||
@ -1431,9 +1434,10 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
|
|||||||
|
|
||||||
/* now, see if there's a connect timeout or a regular timeout to
|
/* now, see if there's a connect timeout or a regular timeout to
|
||||||
use instead of the default one */
|
use instead of the default one */
|
||||||
timeout = conn->data->set.connecttimeout ? conn->data->set.connecttimeout :
|
timeout =
|
||||||
conn->data->set.timeout ? conn->data->set.timeout :
|
conn->data->set.connecttimeout ? conn->data->set.connecttimeout :
|
||||||
300; /* default name resolve timeout in seconds */
|
conn->data->set.timeout ? conn->data->set.timeout :
|
||||||
|
CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */
|
||||||
ticks = GetTickCount();
|
ticks = GetTickCount();
|
||||||
|
|
||||||
status = WaitForSingleObject(td->thread_hnd, 1000UL*timeout);
|
status = WaitForSingleObject(td->thread_hnd, 1000UL*timeout);
|
||||||
|
Loading…
Reference in New Issue
Block a user