Skip to content
Snippets Groups Projects
Commit dd115f88 authored by balazs.hegedus's avatar balazs.hegedus Committed by Chris Leppanen
Browse files

Issue #1724200 by balazs.hegedus: Added Support for drupal_http_request() timeout.

parent 2744dd4b
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva ...@@ -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_HEADER, TRUE);
curl_setopt($download, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($download, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($download, CURLOPT_ENCODING, ''); 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) { if ($accept_invalid_cert) {
curl_setopt($download, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($download, CURLOPT_SSL_VERIFYPEER, 0);
} }
...@@ -212,7 +212,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva ...@@ -212,7 +212,7 @@ function http_request_get($url, $username = NULL, $password = NULL, $accept_inva
} }
} }
else { 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; $result->code = isset($result->code) ? $result->code : 200;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment