[svn:modperl-modules] rev 237 - Apache-DebugFilter/trunk/t/response/TestDebugFilter

[email protected] 6 Jul 2005 19:02:10 -0000
Newsgroups perl.modperl.modules.svn
Message-ID <[email protected]>
Author: stas
Date: Wed Jul  6 12:02:09 2005
New Revision: 237

Modified:
   Apache-DebugFilter/trunk/t/response/TestDebugFilter/bb_dump.pm
Log:
fix the test: starting from Apache 2.0.49 several platforms require you to set the 
socket to a blocking IO mode



Modified: Apache-DebugFilter/trunk/t/response/TestDebugFilter/bb_dump.pm
==============================================================================
--- Apache-DebugFilter/trunk/t/response/TestDebugFilter/bb_dump.pm	(original)
+++ Apache-DebugFilter/trunk/t/response/TestDebugFilter/bb_dump.pm	Wed Jul  6 12:02:09 2005
@@ -4,6 +4,7 @@ use strict;
 use warnings FATAL => 'all';
 
 use Apache2::Connection ();
+use APR::Socket ();
 use APR::Bucket ();
 use APR::Brigade ();
 use APR::Util ();
@@ -13,7 +14,7 @@ use Apache::TestTrace;
 
 use Apache2::DebugFilter;
 
-use APR::Const -compile => qw(SUCCESS EOF);
+use APR::Const -compile => qw(SUCCESS EOF SO_NONBLOCK);
 use Apache2::Const -compile => qw(OK MODE_GETLINE);
 
 sub handler {
@@ -23,6 +24,10 @@ sub handler {
     my $ibb = APR::Brigade->new($c->pool, $ba);
     my $obb = APR::Brigade->new($c->pool, $ba);
 
+    # starting from Apache 2.0.49 several platforms require you to set
+    # the socket to a blocking IO mode
+    $c->client_socket->opt_set(APR::Const::SO_NONBLOCK, 0);
+
     for (;;) {
         my $rv = $c->input_filters->get_brigade($ibb, Apache2::Const::MODE_GETLINE);
         if ($rv != APR::Const::SUCCESS or $ibb->is_empty) {