gozer 2004/07/30 20:08:36
Modified: t/protocol/TestProtocol pseudo_http.pm Log: Found another place where (discovered on OSX) sockets were assumed to be non-blocking when they might not be. Fix test breakage by being explicit about it. Submitted by: stas Revision Changes Path 1.4 +5 -0 modperl-2.0/t/protocol/TestProtocol/pseudo_http.pm Index: pseudo_http.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/pseudo_http.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- pseudo_http.pm 6 Jul 2004 18:51:55 -0000 1.3 +++ pseudo_http.pm 31 Jul 2004 03:08:36 -0000 1.4 @@ -18,6 +18,7 @@ use APR::Socket (); use Apache::Const -compile => qw(OK DONE DECLINED); +use APR::Const -compile => qw(SO_NONBLOCK); my @cmds = qw(date quit); my %commands = map { $_, \&{$_} } @cmds; @@ -25,6 +26,10 @@ sub handler { my $c = shift; my $socket = $c->client_socket; + + if ($socket->opt_get(APR::SO_NONBLOCK)) { + $socket->opt_set(APR::SO_NONBLOCK => 0); + } if ((my $rc = greet($c)) != Apache::OK) { $socket->send("Say HELO first\n");