Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@www.apache.org Received: (qmail 24786 invoked from network); 10 May 2005 16:08:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 May 2005 16:08:39 -0000 Received: (qmail 32826 invoked by uid 500); 10 May 2005 16:11:42 -0000 Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 32782 invoked by uid 500); 10 May 2005 16:11:40 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 32768 invoked by uid 99); 10 May 2005 16:11:40 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 10 May 2005 09:11:40 -0700 Received: (qmail 23539 invoked by uid 65534); 10 May 2005 16:07:59 -0000 Message-ID: <20050510160759.23535.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r169487 - in /perl/modperl/trunk: t/protocol/TestProtocol/echo_bbs.pm t/protocol/TestProtocol/echo_bbs2.pm t/protocol/TestProtocol/echo_filter.pm t/protocol/TestProtocol/echo_nonblock.pm t/protocol/TestProtocol/echo_timeout.pm xs/APR/Status/APR__Status.h xs/maps/apr_functions.map Date: Tue, 10 May 2005 16:07:57 -0000 To: modperl-cvs@perl.apache.org From: randyk@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: randyk Date: Tue May 10 09:07:55 2005 New Revision: 169487 URL: http://svn.apache.org/viewcvs?rev=3D169487&view=3Drev Log: Add is_EOF, is_ECONNABORTED, and is_TIMEUP functions to APR::Status, and use these in the t/protocol/ tests, rather than checking directly against the appropriate APR::Const::*. Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs.pm perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs2.pm perl/modperl/trunk/t/protocol/TestProtocol/echo_filter.pm perl/modperl/trunk/t/protocol/TestProtocol/echo_nonblock.pm perl/modperl/trunk/t/protocol/TestProtocol/echo_timeout.pm perl/modperl/trunk/xs/APR/Status/APR__Status.h perl/modperl/trunk/xs/maps/apr_functions.map Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/protocol/TestProtoc= ol/echo_bbs.pm?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs.pm (original) +++ perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs.pm Tue May 10 09:07= :55 2005 @@ -19,7 +19,8 @@ use Apache::TestTrace; =20 use Apache2::Const -compile =3D> qw(OK MODE_GETLINE); -use APR::Const -compile =3D> qw(SUCCESS EOF SO_NONBLOCK); +use APR::Const -compile =3D> qw(SUCCESS SO_NONBLOCK); +use APR::Status (); =20 sub handler { my $c =3D shift; @@ -33,7 +34,7 @@ while (1) { debug "asking new line"; my $rc =3D $c->input_filters->get_brigade($bb, Apache2::Const::MOD= E_GETLINE); - last if $rc =3D=3D APR::Const::EOF; + last if APR::Status::is_EOF($rc); die APR::Error::strerror($rc) unless $rc =3D=3D APR::Const::SUCCES= S; =20 for (my $b =3D $bb->first; $b; $b =3D $bb->next($b)) { Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs2.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/protocol/TestProtoc= ol/echo_bbs2.pm?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs2.pm (original) +++ perl/modperl/trunk/t/protocol/TestProtocol/echo_bbs2.pm Tue May 10 09:0= 7:55 2005 @@ -14,7 +14,8 @@ use APR::Error (); =20 use Apache2::Const -compile =3D> qw(OK MODE_GETLINE); -use APR::Const -compile =3D> qw(SUCCESS EOF SO_NONBLOCK); +use APR::Const -compile =3D> qw(SUCCESS SO_NONBLOCK); +use APR::Status (); =20 sub handler { my $c =3D shift; @@ -30,7 +31,7 @@ while (1) { my $rc =3D $c->input_filters->get_brigade($bb_in, Apache2::Const::MODE_GETLI= NE); - last if $rc =3D=3D APR::Const::EOF; + last if APR::Status::is_EOF($rc); die APR::Error::strerror($rc) unless $rc =3D=3D APR::Const::SUCCES= S; =20 next unless $bb_in->flatten(my $data); Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_filter.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/protocol/TestProtoc= ol/echo_filter.pm?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/t/protocol/TestProtocol/echo_filter.pm (original) +++ perl/modperl/trunk/t/protocol/TestProtocol/echo_filter.pm Tue May 10 09= :07:55 2005 @@ -13,7 +13,8 @@ =20 use base qw(Apache2::Filter); =20 -use APR::Const -compile =3D> qw(SUCCESS EOF SO_NONBLOCK); +use APR::Const -compile =3D> qw(SUCCESS SO_NONBLOCK); +use APR::Status (); use Apache2::Const -compile =3D> qw(OK MODE_GETLINE); =20 use constant BUFF_LEN =3D> 1024; @@ -39,7 +40,7 @@ =20 while (1) { my $rc =3D $c->input_filters->get_brigade($bb, Apache2::Const::MOD= E_GETLINE); - last if $rc =3D=3D APR::Const::EOF; + last if APR::Status::is_EOF($rc); die APR::Error::strerror($rc) unless $rc =3D=3D APR::Const::SUCCES= S; =20 # fflush is the equivalent of the following 3 lines of code: Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_nonblock.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/protocol/TestProtoc= ol/echo_nonblock.pm?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/t/protocol/TestProtocol/echo_nonblock.pm (original) +++ perl/modperl/trunk/t/protocol/TestProtocol/echo_nonblock.pm Tue May 10 = 09:07:55 2005 @@ -12,8 +12,8 @@ use Apache::TestTrace; =20 use Apache2::Const -compile =3D> 'OK'; -use APR::Const -compile =3D> qw(SO_NONBLOCK TIMEUP SUCCESS POLLIN - ECONNABORTED); +use APR::Const -compile =3D> qw(SO_NONBLOCK SUCCESS POLLIN); +use APR::Status (); =20 use constant BUFF_LEN =3D> 1024; =20 @@ -43,7 +43,7 @@ my $len =3D eval { $socket->recv($buf, BUFF_LEN) }; if ($@) { die $@ unless ref $@ eq 'APR::Error' - && $@ =3D=3D APR::Const::ECONNABORTED; # rethrow + && APR::Status::is_ECONNABORTED($@); # rethrow # ECONNABORTED is not an application error # XXX: we don't really test that we always get this # condition, since it depends on the timing of the @@ -60,7 +60,7 @@ debug "sending: $buf"; $socket->send($buf); } - elsif ($rc =3D=3D APR::Const::TIMEUP) { + elsif (APR::Status::is_TIMEUP($rc)) { debug "timeout"; $socket->send("TIMEUP\n"); } Modified: perl/modperl/trunk/t/protocol/TestProtocol/echo_timeout.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/protocol/TestProtoc= ol/echo_timeout.pm?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/t/protocol/TestProtocol/echo_timeout.pm (original) +++ perl/modperl/trunk/t/protocol/TestProtocol/echo_timeout.pm Tue May 10 0= 9:07:55 2005 @@ -12,7 +12,8 @@ use APR::Socket (); =20 use Apache2::Const -compile =3D> 'OK'; -use APR::Const -compile =3D> qw(TIMEUP SO_NONBLOCK); +use APR::Const -compile =3D> qw(SO_NONBLOCK); +use APR::Status (); =20 use constant BUFF_LEN =3D> 1024; =20 @@ -32,7 +33,7 @@ my $buff; my $rlen =3D eval { $socket->recv($buff, BUFF_LEN) }; if ($@) { - die "timed out, giving up: $@" if $@ =3D=3D APR::Const::TIMEUP; + die "timed out, giving up: $@" if APR::Status::is_TIMEUP($@); die $@; } =20 @@ -40,7 +41,7 @@ =20 my $wlen =3D eval { $socket->send($buff) }; if ($@) { - die "timed out, giving up: $@" if $@ =3D=3D APR::Const::TIMEUP; + die "timed out, giving up: $@" if APR::Status::is_TIMEUP($@); die $@; } } Modified: perl/modperl/trunk/xs/APR/Status/APR__Status.h URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/APR/Status/APR__St= atus.h?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/xs/APR/Status/APR__Status.h (original) +++ perl/modperl/trunk/xs/APR/Status/APR__Status.h Tue May 10 09:07:55 2005 @@ -18,3 +18,6 @@ #define mpxs_APR__Status_is_EAGAIN APR_STATUS_IS_EAGAIN #define mpxs_APR__Status_is_EACCES APR_STATUS_IS_EACCES #define mpxs_APR__Status_is_ENOENT APR_STATUS_IS_ENOENT +#define mpxs_APR__Status_is_EOF APR_STATUS_IS_EOF +#define mpxs_APR__Status_is_ECONNABORTED APR_STATUS_IS_ECONNABORTED +#define mpxs_APR__Status_is_TIMEUP APR_STATUS_IS_TIMEUP Modified: perl/modperl/trunk/xs/maps/apr_functions.map URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/xs/maps/apr_functions= .map?rev=3D169487&r1=3D169486&r2=3D169487&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- perl/modperl/trunk/xs/maps/apr_functions.map (original) +++ perl/modperl/trunk/xs/maps/apr_functions.map Tue May 10 09:07:55 2005 @@ -648,6 +648,9 @@ -apr_os_shm_put =20 MODULE=3DAPR::Status PREFIX=3Dmpxs_APR__STATUS_ - int:DEFINE_is_EAGAIN | | apr_status_t:rc - int:DEFINE_is_EACCES | | apr_status_t:rc - int:DEFINE_is_ENOENT | | apr_status_t:rc + int:DEFINE_is_EAGAIN | | apr_status_t:rc + int:DEFINE_is_EACCES | | apr_status_t:rc + int:DEFINE_is_ENOENT | | apr_status_t:rc + int:DEFINE_is_EOF | | apr_status_t:rc + int:DEFINE_is_ECONNABORTED | | apr_status_t:rc + int:DEFINE_is_TIMEUP | | apr_status_t:rc