set a 5 second connection timeout at the curl layer

This commit is contained in:
root
2014-12-28 14:00:23 -06:00
parent ae52c4c647
commit b83eb74551

View File

@@ -70,6 +70,10 @@ static void http_curl_reset(mfhttp * conn)
curl_easy_setopt(conn->curl_handle, CURLOPT_ERRORBUFFER, conn->error_buf); curl_easy_setopt(conn->curl_handle, CURLOPT_ERRORBUFFER, conn->error_buf);
curl_easy_setopt(conn->curl_handle, CURLOPT_PROXY, getenv("http_proxy")); curl_easy_setopt(conn->curl_handle, CURLOPT_PROXY, getenv("http_proxy"));
curl_easy_setopt(conn->curl_handle, CURLOPT_VERBOSE, 0L); curl_easy_setopt(conn->curl_handle, CURLOPT_VERBOSE, 0L);
// it should never take 5 seconds to establish a connection to the server
curl_easy_setopt(conn->curl_handle, CURLOPT_CONNECTTIMEOUT_MS,5000L);
//curl_easy_setopt(conn->curl_handle, CURLOPT_SSL_VERIFYPEER, 0L); //curl_easy_setopt(conn->curl_handle, CURLOPT_SSL_VERIFYPEER, 0L);
} }