You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tyler Bird <bi...@epromo.com> on 2007/09/21 19:48:54 UTC

Downloading SpreadSheet Data with Apache

Hi,

I have written a script to wait 800 seconds and then send a html content 
type header
and a line of text.

The server I am using is apache 1.3 with mod_perl 1.x


I run this script and the log files show the incrementing numbers in the 
for loop, but
whats weird is that the browser seems to still be "downloading" you know 
that little icon seems to be spinning
and I see no output not and html header of any line of text.

--

my $max = 60 * 8;

for( my $i = 0; $i < $max; $i++)
{

        my $j = $i + 1;
        warn("iteration: " . $j);
        sleep(1);      


}

require in;
in::ct();
print("successfully rendered on dev");

exit();

--

any ideas on why the browser is not receiving or the webserver is not 
sending this content?

Anybody need any clarifications?

Tyler

Re: Downloading SpreadSheet Data with Apache

Posted by Issac Goldstand <ma...@beamartyr.net>.
Make sure that you set a TimeOut in httpd.conf greater than your 
script's delay:
http://httpd.apache.org/docs/2.2/mod/core.html#timeout

  Issac

Tyler Bird wrote:
> Michael Peters wrote:
>> Tyler Bird wrote:
>>
>>  
>>> I run this script and the log files show the incrementing numbers in 
>>> the
>>> for loop, but
>>> whats weird is that the browser seems to still be "downloading" you 
>>> know
>>> that little icon seems to be spinning
>>> and I see no output not and html header of any line of text.
>>>     
>>
>> You need to tell the server not to buffer your output. Do something 
>> like this at
>> the top of the routine you use to output the stream.
>>
>>   local $| = 1;
>>
>>  
>>> any ideas on why the browser is not receiving or the webserver is not
>>> sending this content?
>>>     
>>
>> If you need to know what's happening HTTP wise, use some network 
>> analyzing tool
>> like ethereal. But my guess is just that your web server isn't 
>> sending the info
>> yet cause it's buffer isn't full.
>>
>>   
> Yes I did try this ( putting in the $| = 1 ) and the behavior did not 
> change the browser still appeared to be downloading
> and the log files had all the numbers in the for() loop.   my browser 
> didn't seem to receive the content-type or the body of the response ( 
> statments below for loop )
> I am going to re look over $|
>
>
> Here is the full version incase there is something I am missing.
>
> --cut
>
> local $| = 1;
>
> require in;
>
> my $max = 60 * 8;
>
> foreach ( my $i = 0; $i < $max; $i++)
> {
>        warn("sleeping, iteration: " . $i);
>        sleep(1);
>
> }
>
> in::ct();
> print("I rendered");
>
> -- end

Re: Downloading SpreadSheet Data with Apache

Posted by Tyler Bird <bi...@epromo.com>.
Michael Peters wrote:
> Tyler Bird wrote:
>
>   
>> I run this script and the log files show the incrementing numbers in the
>> for loop, but
>> whats weird is that the browser seems to still be "downloading" you know
>> that little icon seems to be spinning
>> and I see no output not and html header of any line of text.
>>     
>
> You need to tell the server not to buffer your output. Do something like this at
> the top of the routine you use to output the stream.
>
>   local $| = 1;
>
>   
>> any ideas on why the browser is not receiving or the webserver is not
>> sending this content?
>>     
>
> If you need to know what's happening HTTP wise, use some network analyzing tool
> like ethereal. But my guess is just that your web server isn't sending the info
> yet cause it's buffer isn't full.
>
>   
Yes I did try this ( putting in the $| = 1 ) and the behavior did not 
change the browser still appeared to be downloading
and the log files had all the numbers in the for() loop.   my browser 
didn't seem to receive the content-type or the body of the response ( 
statments below for loop )
I am going to re look over $|


Here is the full version incase there is something I am missing.

--cut

local $| = 1;

require in;

my $max = 60 * 8;

foreach ( my $i = 0; $i < $max; $i++)
{
        warn("sleeping, iteration: " . $i);
        sleep(1);

}

in::ct();
print("I rendered");

-- end

Re: Downloading SpreadSheet Data with Apache

Posted by Michael Peters <mp...@plusthree.com>.
Tyler Bird wrote:

> I run this script and the log files show the incrementing numbers in the
> for loop, but
> whats weird is that the browser seems to still be "downloading" you know
> that little icon seems to be spinning
> and I see no output not and html header of any line of text.

You need to tell the server not to buffer your output. Do something like this at
the top of the routine you use to output the stream.

  local $| = 1;

> any ideas on why the browser is not receiving or the webserver is not
> sending this content?

If you need to know what's happening HTTP wise, use some network analyzing tool
like ethereal. But my guess is just that your web server isn't sending the info
yet cause it's buffer isn't full.

-- 
Michael Peters
Developer
Plus Three, LP