Re: mod_perl, mod_gzip and connection->fileno

[prev] [thread] [next] [Date index for 2005/02/19]

From: Marcel Greter
Subject: Re: mod_perl, mod_gzip and connection->fileno
Date: 04:14 on 19 Feb 2005
Stas Bekman schrieb:

>>    ... my $fileno = $connection->fileno(0);
>>    vec(my $rin = '', $fileno, 1) = 1;
>>    select(my $rout = $rin, undef, undef, 0);
>
>
> Is this better that IO::Select in [2]?
>
It should do the same thing. IMHO IO::Select is just a frontend for the 
core select function, so you don't need to fiddle with vec yourself. One 
can save some memory (504 KB here) if you use the core select function 
directly and don't load IO::Select, which is always a good thing.

>> ... The problem is that under mod_gzip, the output socket points to a 
>> "spool" file, used by mod_gzip. The examples on the net simply use 
>> $c->fileno, which will return the output file-descriptor (as written 
>> in the docs). When using mod_gzip, the check_function will not behave 
>> correctly. So for the "connection_check" function you must pass 0 to 
>> fileno to get the input file-descriptor.
>
>
> Interesting.
>
> But I guess this technique still want work in the proxied front-end 
> <-> back-end setup, since the front end doesn't abort the connection 
> to the back-end, even if the client did abort it.
>
I would say so! My problem was just under mod_gzip. Normally the code 
from the examples works correctly.

> Also take a look at: 
> http://perl.apache.org/docs/1.0/guide/debug.html#Handling_the__User_pressed_Stop_button__case 
>
> It's directly related and should probably be merged into one item. or 
> at least xref each other.
>
I'm checking the return value of each print, so this should take care of 
this case.

Marcel Greter

(message missing)

mod_perl, mod_gzip and connection->fileno
Marcel Greter 22:11 on 18 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Stas Bekman 00:58 on 19 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Marcel Greter 04:14 on 19 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Stas Bekman 04:18 on 19 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Marcel Greter 04:41 on 19 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Stas Bekman 05:12 on 19 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Geoffrey Young 20:13 on 24 Feb 2005

Re: mod_perl, mod_gzip and connection->fileno
Geoffrey Young 14:43 on 24 Feb 2005

Generated at 22:43 on 24 Feb 2005 by mariachi v0.52