Merge branch 'master' into docker

This commit is contained in:
dosse91 2017-09-05 07:47:50 +02:00
commit 6b3e741574
2 changed files with 11 additions and 8 deletions

2
doc.md
View file

@ -164,7 +164,7 @@ w.postMessage('start {"param1": "value1", "param2": "value2", ...}')
* __garbagePhp_chunkSize__: size of chunks sent by garbage.php in megabytes
* Default: `20`
* Recommended: `>=10`
* Default override: 5 on Safari if enable_quirks is true
* Maximum: `100`
* __xhr_dlMultistream__: how many streams should be opened for the download test
* Default: `10`
* Recommended: `>=3`

View file

@ -4,21 +4,24 @@
@ini_set('output_buffering', 'Off');
@ini_set('output_handler', '');
// Headers
header( "HTTP/1.1 200 OK" );
header('HTTP/1.1 200 OK');
// Download follows...
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=random.dat');
header('Content-Disposition: attachment; filename=random.dat');
header('Content-Transfer-Encoding: binary');
// Never cache me
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
// Generate data
$data=openssl_random_pseudo_bytes(1048576);
// Deliver chunks of 1048576 bytes
for($i=0;$i<intval($_GET["ckSize"]);$i++){
$chunks=isset($_GET['ckSize']) ? intval($_GET['ckSize']) : 4;
if(empty($chunks)){$chunks = 4;}
if($chunks>100){$chunks = 100;}
for($i=0;$i<$chunks;$i++){
echo $data;
flush();
}
?>
?>