Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
<?
2
/* honey.php - sample fake delay script to push data
3
   - should use ob_flush() to send chunks rather than
4
   just take a long time ...
5
*/
6
 
7
session_start();
8
 
9
$char = " ";
10
$fakeDelay = (empty($_GET['delay'])) ? 1 : $_GET['delay'];
11
$dataSize = (empty($_GET['size'])) ? 2*1024 : $_GET['size'];
12
if (empty($_SESSION['counter'])) $_SESSION['counter'] = 1;
13
$dataSent = 0;
14
$blockSize = 1024;
15
 
16
if ($fakeDelay) { sleep($fakeDelay); }
17
 
18
print "view num: ".$_SESSION['counter']++;
19
while ($dataSent<=$dataSize) {
20
	for ($i=0; $i<$blockSize/4; $i++) {
21
		print $char;
22
	} print "<br />";
23
	$dataSent += $blockSize;
24
	sleep(1);
25
}
26
 
27
?>