From dd115f886130e2f8a45832380dd86d4a71d2199c Mon Sep 17 00:00:00 2001 From: "balazs.hegedus" <balazs.hegedus@263287.no-reply.drupal.org> Date: Fri, 24 Aug 2012 18:35:51 +0200 Subject: [PATCH] Issue #1724200 by balazs.hegedus: Added Support for drupal_http_request() timeout. --- libraries/http_request.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/http_request.inc b/libraries/http_request.inc index d5a36456..44f4fb59 100644 --- a/libraries/http_request.inc +++ b/libraries/http_request.inc @@ -168,7 +168,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva curl_setopt($download, CURLOPT_HEADER, TRUE); curl_setopt($download, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($download, CURLOPT_ENCODING, ''); - curl_setopt($download, CURLOPT_TIMEOUT, variable_get('http_request_timeout', 15)); + curl_setopt($download, CURLOPT_TIMEOUT, variable_get('http_request_timeout', 30)); if ($accept_invalid_cert) { curl_setopt($download, CURLOPT_SSL_VERIFYPEER, 0); } @@ -212,7 +212,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva } } else { - $result = drupal_http_request($url, array('headers' => $headers)); + $result = drupal_http_request($url, array('headers' => $headers, 'timeout' => variable_get('http_request_timeout', 30))); } $result->code = isset($result->code) ? $result->code : 200; -- GitLab