Dirk van der Zee wrote:
Hi All,I have written a POP3 protocol-handler which uses the PerlProcessConnectionHandler. The solution worked fine under Apache 2.0 and ModPerl 2.0, but after an upgrade to Apache 2.2 and Mod_Perl 2.0.2 it doesn't work correctly. (We upgraded from Ubuntu-Dapper to Ubuntu-Gutsy).
That's could be because since Apache 2.0.49, you have need to set the socket to blocking mode explicitely. From the test suite: # starting from Apache 2.0.49 several platforms require you to set # the socket to a blocking IO mode my $nonblocking = $socket->opt_get(APR::Const::SO_NONBLOCK); if ($nonblocking) { $socket->opt_set(APR::Const::SO_NONBLOCK, 0); # test that we really *are* in the blocking mode !$socket->opt_get(APR::Const::SO_NONBLOCK) or die "failed to set blocking mode"; }
Specifically the problem is that the "sub handler" gets called only after the client sends a linefeed. In the old situation the handler started directly. The POP3 protocol needs a "+OK" responseafter the connection has been established.
Are you sure of that, I would think your handler gets called, just that the $sock->send() gets buffered incorrectly, and not sent to the client yet. -- Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5 http://gozer.ectoplasm.org/ m/gozer\@(apache|cpan|ectoplasm)\.org/
signature.asc
Description: OpenPGP digital signature