05-15-2009, 11:20 AM
Join Date: May 2009
Turn off buffering!?
I wrote a code in php to read a file from remote server and send the content to a user , something like a proxy.
$fp = fsockopen('address.com', 80, $errno, $errstr);
...//some code to send headers to http://address.com/ server to get 1.rar file.
echo fgets($fp, '1024');
for example if 1.rar is about 50meg , and a user have 100KB connection ,when he start to download that file , the server read that file with 10 MB speed and send it to user.That cause server to read all file and buffer it and send it to user , and get more memory.
I can't limit the script speed , because my users have different speed , but I want my script read data and wait until the data send to user and then read the next segment of data.
Is there any config in litespeed to correct this for me?