]> git.wh0rd.org - tt-rss.git/commitdiff
fetch_file_contents: set timeout when not using CURL
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 24 Oct 2016 13:12:18 +0000 (16:12 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 24 Oct 2016 13:12:18 +0000 (16:12 +0300)
include/functions.php

index 3dea5677a9970515e22e546ca193e3f57737e169..f10c3a00b0015e650958f17c63d601b189064051 100755 (executable)
                                }
                        }
 
+                       // 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)
                                          )));
                                 $context = stream_context_create(array(
                                          'http' => array(
                                                        'method' => 'GET',
+                                                   'timeout' => $timeout ? $timeout : FILE_FETCH_TIMEOUT,
                                                        'protocol_version'=> 1.1
                                          )));
                        }