From b83eb745519db36bc1988f3ea6649cf2801db885 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 28 Dec 2014 14:00:23 -0600 Subject: [PATCH] set a 5 second connection timeout at the curl layer --- utils/http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/http.c b/utils/http.c index 91d4121..e0b3df4 100644 --- a/utils/http.c +++ b/utils/http.c @@ -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_PROXY, getenv("http_proxy")); 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); }