summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-02-16 13:30:39 +0100
committerAndreas Gohr <andi@splitbrain.org>2013-02-16 13:30:39 +0100
commita59514197ff8cbfaeb42520106e7cbd0988f3fb5 (patch)
tree260604cf9d4349cf2b249cec54c50751f4345eac
parent4def61cfe42f331ab696463fa2fa4cfc452df23b (diff)
downloadrpg-a59514197ff8cbfaeb42520106e7cbd0988f3fb5.tar.gz
rpg-a59514197ff8cbfaeb42520106e7cbd0988f3fb5.tar.bz2
don't use keep-alive with single shot HTTP clients
-rw-r--r--inc/io.php1
-rw-r--r--inc/media.php2
2 files changed, 3 insertions, 0 deletions
diff --git a/inc/io.php b/inc/io.php
index b4da7d635..5ecc79703 100644
--- a/inc/io.php
+++ b/inc/io.php
@@ -474,6 +474,7 @@ function io_download($url,$file,$useAttachment=false,$defaultName='',$maxSize=20
$http = new DokuHTTPClient();
$http->max_bodysize = $maxSize;
$http->timeout = 25; //max. 25 sec
+ $http->keep_alive = false; // we do single ops here, no need for keep-alive
$data = $http->get($url);
if(!$data) return false;
diff --git a/inc/media.php b/inc/media.php
index 572b1177c..7e1b2152d 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -1878,6 +1878,8 @@ function media_get_from_URL($url,$ext,$cache){
function media_image_download($url,$file){
global $conf;
$http = new DokuHTTPClient();
+ $http->keep_alive = false; // we do single ops here, no need for keep-alive
+
$http->max_bodysize = $conf['fetchsize'];
$http->timeout = 25; //max. 25 sec
$http->header_regexp = '!\r\nContent-Type: image/(jpe?g|gif|png)!i';