Skip to content
Snippets Groups Projects
Commit a5951419 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

don't use keep-alive with single shot HTTP clients

parent 4def61cf
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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';
......
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