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

Reply via email to