diff options
author | Andrew Dolgov <[email protected]> | 2016-10-24 16:12:18 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-10-24 16:12:18 +0300 |
commit | 3bba9c396f0ed586fed75e38d8f7db380ee86122 (patch) | |
tree | 8a2915f37b0e1039c87dd4d9d2daacd0d232a17b | |
parent | e3dceca66b041af425621ef1a1431a1bd15d132b (diff) |
fetch_file_contents: set timeout when not using CURL
-rwxr-xr-x | include/functions.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 3dea5677a..f10c3a00b 100755 --- a/include/functions.php +++ b/include/functions.php @@ -462,10 +462,13 @@ } } + // TODO: should this support POST requests or not? idk + if (!$post_query && $timestamp) { $context = stream_context_create(array( 'http' => array( 'method' => 'GET', + 'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT, 'protocol_version'=> 1.1, 'header' => "If-Modified-Since: ".gmdate("D, d M Y H:i:s \\G\\M\\T\r\n", $timestamp) ))); @@ -473,6 +476,7 @@ $context = stream_context_create(array( 'http' => array( 'method' => 'GET', + 'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT, 'protocol_version'=> 1.1 ))); } |