You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Malcolm J Harwood <mj...@liminalflux.net> on 2005/11/23 15:53:40 UTC
mp2 broken connection detection
The cookbook (recipe 4.9) claims that $c->aborted is only true after you've
actually sent data to the client and flushed the buffers. For testing if the
client is still connected, it recommends doing something like:
$c = Apache->request->connection;
return if ($c->aborted);
$s = IO::Select->new($c->fileno);
return if ($s->can_read(0));
return 1;
Which presumably works fine with mp1, but doesn't at all with mp2.
$c->fileno no longer exists
the closest seems to be
$c->client_socket
but it's not obvious from the documentation how one would check that. Is it
even needed, or does $c->aborted check whether the socket is open in mp2?
--
"One has no desire to be devoured by alien monstrosities,
even in the cause of political progress".
- Kalik, Dr Who: Carnival of Monsters