#define ARES_SUCCESS CURLE_OK
#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 */
static curl_hash hostname_cache;
static int host_cache_initialized;
diff = Curl_tvdiff(Curl_tvnow(),
data->progress.t_startsingle)/1000;
- if(diff > 180) {
- /* Waited >180 seconds, this is a name resolve timeout! */
+ if(diff > CURL_TIMEOUT_RESOLVE) {
+ /* Waited many seconds, this is a name resolve timeout! */
failf(data, "Name resolve timeout after %ld seconds", diff);
return CURLE_OPERATION_TIMEDOUT;
}
CURLcode rc=CURLE_OK;
struct SessionHandle *data = conn->data;
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
use instead of the default one */
/* now, see if there's a connect timeout or a regular timeout to
use instead of the default one */
- timeout = conn->data->set.connecttimeout ? conn->data->set.connecttimeout :
- conn->data->set.timeout ? conn->data->set.timeout :
- 300; /* default name resolve timeout in seconds */
+ timeout =
+ conn->data->set.connecttimeout ? conn->data->set.connecttimeout :
+ conn->data->set.timeout ? conn->data->set.timeout :
+ CURL_TIMEOUT_RESOLVE; /* default name resolve timeout */
ticks = GetTickCount();
status = WaitForSingleObject(td->thread_hnd, 1000UL*timeout);