Philip M. Gollucci wrote:
FreeBSD 6.0-current/i386
perl 5.9.3 w/out threads
httpd2, apr/apr-uti, modperl from svn trunk
[...]
t/protocol/eliza..................1..7
# Running under perl version 5.009003 for freebsd
# Current time local: Tue Apr 5 03:13:06 2005
# Current time GMT: Tue Apr 5 07:13:06 2005
# Using Test.pm version 1.25
# Using Apache/Test.pm version 1.22
ok 1
# send: Hello Eliza
# recv: How do you do. Please state your problem.
ok 2
# send: How are you?
# recv:
# Failed test 3 in t/protocol/eliza.t at line 25 fail #2
not ok 3
# Failed test 4 in t/protocol/eliza.t at line 25 fail #3
# send: Why do I have core dumped?
# recv:
# Failed test 5 in t/protocol/eliza.t at line 25 fail #4
not ok 4
# send: I feel like writing some tests today, what about you?
# Failed test 6 in t/protocol/eliza.t at line 25 fail #5
# recv:
not ok 5
# send: Good bye, Eliza
# recv:
not ok 6
# Eliza shouldn't respond anymore
ok 7
FAILED tests 3-6
Failed 4/7 tests, 42.86% okay
This should fix the problem. I've committed it already.
Index: t/protocol/TestProtocol/eliza.pm
===================================================================
--- t/protocol/TestProtocol/eliza.pm (revision 160192)
+++ t/protocol/TestProtocol/eliza.pm (working copy)
@@ -18,6 +18,17 @@
my Apache2::Connection $c = shift;
my APR::Socket $socket = $c->client_socket;
+ # 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";
+ }
+
my $last = 0;
while ($socket->recv(my $buff, BUFF_LEN)) {
# \r is sent instead of \n if the client is talking over telnet
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]