/[Apache-SVN]/perl/modperl/trunk/t/protocol/TestProtocol/eliza.pm
ViewVC logotype

Diff of /perl/modperl/trunk/t/protocol/TestProtocol/eliza.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- perl/modperl/trunk/t/protocol/TestProtocol/eliza.pm	2005/04/05 16:32:51	160196
+++ perl/modperl/trunk/t/protocol/TestProtocol/eliza.pm	2005/04/05 16:34:54	160197
@@ -18,6 +18,17 @@ sub handler {
     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

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26