stas 2004/04/22 16:14:32
Modified: src/modules/perl modperl_util.h t/protocol/TestProtocol echo.pm xs/APR/Socket APR__Socket.h xs/tables/current/ModPerl FunctionTable.pm . Changes Log: go back to the croak-on-error interface Revision Changes Path 1.55 +0 -12 modperl-2.0/src/modules/perl/modperl_util.h Index: modperl_util.h =================================================================== RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -u -r1.54 -r1.55 --- modperl_util.h 8 Apr 2004 20:47:41 -0000 1.54 +++ modperl_util.h 22 Apr 2004 23:14:31 -0000 1.55 @@ -72,18 +72,6 @@ } \ } while (0) - -/* runs a given code and if failed sets $APR::err to the error message - * and returns &PL_sv_undef */ -#define MP_APR_RETURN_ON_FAILURE(rc_run) do { \ - apr_status_t rc = (rc_run); \ - if (rc != APR_SUCCESS) { \ - GV *gv = gv_fetchpv("APR::err", GV_ADDMULTI, SVt_PV); \ - sv_setpv(GvSV(gv), modperl_apr_strerror(rc)); \ - return &PL_sv_undef; \ - } \ - } while (0) - /* check whether the response phase has been initialized already */ #define MP_CHECK_WBUCKET_INIT(func) \ if (!rcfg->wbucket) { \ 1.6 +1 -7 modperl-2.0/t/protocol/TestProtocol/echo.pm Index: echo.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/protocol/TestProtocol/echo.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- echo.pm 8 Apr 2004 20:47:41 -0000 1.5 +++ echo.pm 22 Apr 2004 23:14:31 -0000 1.6 @@ -19,17 +19,11 @@ # on some platforms (e.g. OSX/Solaris) httpd hands us a # non-blocking socket my $nonblocking = $socket->opt_get(APR::SO_NONBLOCK); - die "failed to \$socket->opt_get: $ARP::err" - unless defined $nonblocking; if ($nonblocking) { - my $prev_value = $socket->opt_set(APR::SO_NONBLOCK => 0); - die "failed to \$socket->opt_set: $ARP::err" - unless defined $prev_value; + my $success = $socket->opt_set(APR::SO_NONBLOCK => 0); # test that we really are in the non-blocking mode $nonblocking = $socket->opt_get(APR::SO_NONBLOCK); - die "failed to \$socket->opt_get: $ARP::err" - unless defined $nonblocking; die "failed to set non-blocking mode" if $nonblocking; } 1.6 +7 -10 modperl-2.0/xs/APR/Socket/APR__Socket.h Index: APR__Socket.h =================================================================== RCS file: /home/cvs/modperl-2.0/xs/APR/Socket/APR__Socket.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -u -r1.5 -r1.6 --- APR__Socket.h 8 Apr 2004 20:47:41 -0000 1.5 +++ APR__Socket.h 22 Apr 2004 23:14:31 -0000 1.6 @@ -64,20 +64,17 @@ return t; } -static MP_INLINE SV * -mpxs_APR__Socket_opt_get(pTHX_ apr_socket_t *socket, apr_int32_t opt) +static MP_INLINE +apr_int32_t mpxs_APR__Socket_opt_get(pTHX_ apr_socket_t *socket, apr_int32_t opt) { apr_int32_t val; - MP_APR_RETURN_ON_FAILURE(apr_socket_opt_get(socket, opt, &val)); - return newSViv(val); + MP_FAILURE_CROAK(apr_socket_opt_get(socket, opt, &val)); + return val; } -static MP_INLINE SV * -mpxs_APR__Socket_opt_set(pTHX_ apr_socket_t *socket, apr_int32_t opt, +static MP_INLINE +void mpxs_APR__Socket_opt_set(pTHX_ apr_socket_t *socket, apr_int32_t opt, apr_int32_t val) { - apr_int32_t oldval; - MP_APR_RETURN_ON_FAILURE(apr_socket_opt_get(socket, opt, &oldval)); - MP_APR_RETURN_ON_FAILURE(apr_socket_opt_set(socket, opt, val)); - return newSViv(oldval); + MP_FAILURE_CROAK(apr_socket_opt_set(socket, opt, val)); } 1.152 +3 -3 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm =================================================================== RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.151 retrieving revision 1.152 diff -u -u -r1.151 -r1.152 --- FunctionTable.pm 14 Apr 2004 03:42:42 -0000 1.151 +++ FunctionTable.pm 22 Apr 2004 23:14:31 -0000 1.152 @@ -2,7 +2,7 @@ # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Tue Apr 13 18:00:36 2004 +# ! Thu Apr 22 13:15:57 2004 # ! do NOT edit, any changes will be lost ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -5406,7 +5406,7 @@ ] }, { - 'return_type' => 'SV *', + 'return_type' => 'apr_int32_t', 'name' => 'mpxs_APR__Socket_opt_get', 'args' => [ { @@ -5424,7 +5424,7 @@ ] }, { - 'return_type' => 'SV *', + 'return_type' => 'void', 'name' => 'mpxs_APR__Socket_opt_set', 'args' => [ { 1.360 +2 -1 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.359 retrieving revision 1.360 diff -u -u -r1.359 -r1.360 --- Changes 22 Apr 2004 22:30:55 -0000 1.359 +++ Changes 22 Apr 2004 23:14:31 -0000 1.360 @@ -13,7 +13,8 @@ =item 1.99_14-dev significantly speedup the startup of threaded mpm test suite, by -configuring only the minimal number of perl interprters to start [Stas] +configuring only the minimal number of perl interpreters to start +[Stas] make APR::Socket::opt_(set|get) working (and change the previous behavior) [Stas]