stas        2004/05/03 23:19:12

  Modified:    src/modules/perl modperl_filter.c modperl_io_apache.c
                        modperl_util.h
               t/filter/TestFilter both_str_con_add.pm
               t/response/TestAPR util.pm
               xs       modperl_xs_util.h
               xs/APR/PerlIO apr_perlio.c
               xs/APR/Util APR__Util.h
  Log:
  deploy the new api modperl_error_strerror and APR::Error::strerr (instead
  of modperl_apr_strerror and APR::strerror)
  
  Revision  Changes    Path
  1.88      +1 -1      modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -u -r1.87 -r1.88
  --- modperl_filter.c  16 Mar 2004 00:59:45 -0000      1.87
  +++ modperl_filter.c  4 May 2004 06:19:11 -0000       1.88
  @@ -643,7 +643,7 @@
                          MP_FILTER_NAME_FORMAT
                          "read in: apr_bucket_read error: %s\n",
                          MP_FILTER_NAME(filter->f),
  -                       modperl_apr_strerror(filter->rc));
  +                       modperl_error_strerror(aTHX_ filter->rc));
               return len;
           }
   
  
  
  
  1.18      +3 -3      modperl-2.0/src/modules/perl/modperl_io_apache.c
  
  Index: modperl_io_apache.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io_apache.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -u -r1.17 -r1.18
  --- modperl_io_apache.c       4 Mar 2004 06:01:07 -0000       1.17
  +++ modperl_io_apache.c       4 May 2004 06:19:11 -0000       1.18
  @@ -156,7 +156,7 @@
           
       rv = modperl_wbucket_write(aTHX_ rcfg->wbucket, vbuf, &count);
       if (rv != APR_SUCCESS) {
  -        Perl_croak(aTHX_ modperl_apr_strerror(rv)); 
  +        Perl_croak(aTHX_ modperl_error_strerror(aTHX_ rv)); 
       }
       bytes += count;
       
  @@ -305,7 +305,7 @@
                   error = SvPV(ERRSV, n_a);
               }
               else {
  -                error = modperl_apr_strerror(rc);
  +                error = modperl_error_strerror(aTHX_ rc);
               }
               sv_setpv(ERRSV,
                        (char *)apr_psprintf(r->pool, 
  @@ -341,7 +341,7 @@
               sv_setpv(ERRSV,
                        (char *)apr_psprintf(r->pool, 
                                             "failed to read: %s",
  -                                          modperl_apr_strerror(rc)));
  +                                          modperl_error_strerror(aTHX_ rc)));
               return -1;
           }
           total += read;
  
  
  
  1.56      +3 -3      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.55
  retrieving revision 1.56
  diff -u -u -r1.55 -r1.56
  --- modperl_util.h    22 Apr 2004 23:14:31 -0000      1.55
  +++ modperl_util.h    4 May 2004 06:19:11 -0000       1.56
  @@ -65,10 +65,12 @@
   #define MP_magical_tie(sv, mg_flags) \
       SvFLAGS((SV*)sv) |= mg_flags
   
  +
  +/* XXX: this should be removed */
   #define MP_FAILURE_CROAK(rc_run) do { \
           apr_status_t rc = rc_run; \
           if (rc != APR_SUCCESS) { \
  -            Perl_croak(aTHX_ modperl_apr_strerror(rc)); \
  +            Perl_croak(aTHX_ modperl_error_strerror(aTHX_ rc)); \
           } \
       } while (0)
   
  @@ -101,8 +103,6 @@
   
   MP_INLINE SV *modperl_perl_sv_setref_uv(pTHX_ SV *rv,
                                           const char *classname, UV uv);
  -
  -char *modperl_apr_strerror(apr_status_t rv);
   
   int modperl_errsv(pTHX_ int status, request_rec *r, server_rec *s);
   
  
  
  
  1.10      +2 -1      modperl-2.0/t/filter/TestFilter/both_str_con_add.pm
  
  Index: both_str_con_add.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/both_str_con_add.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -u -r1.9 -r1.10
  --- both_str_con_add.pm       8 Apr 2004 01:42:53 -0000       1.9
  +++ both_str_con_add.pm       4 May 2004 06:19:11 -0000       1.10
  @@ -10,6 +10,7 @@
   use APR::Bucket ();
   use APR::Brigade ();
   use APR::Util ();
  +use APR::Error ();
   
   use base qw(Apache::Filter);
   
  @@ -57,7 +58,7 @@
       for (;;) {
           my $rv = $c->input_filters->get_brigade($bb, Apache::MODE_GETLINE);
           if ($rv != APR::SUCCESS && $rv != APR::EOF) {
  -            my $error = APR::strerror($rv);
  +            my $error = APR::Error::strerror($rv);
               warn __PACKAGE__ . ": get_brigade: $error\n";
               last;
           }
  
  
  
  1.7       +2 -1      modperl-2.0/t/response/TestAPR/util.pm
  
  Index: util.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/util.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- util.pm   24 May 2002 18:08:21 -0000      1.6
  +++ util.pm   4 May 2004 06:19:12 -0000       1.7
  @@ -7,6 +7,7 @@
   use Apache::TestUtil;
   
   use APR::Util ();
  +use APR::Error ();
   
   use Apache::Const -compile => 'OK';
   use APR::Const -compile => 'EMISMATCH';
  @@ -25,7 +26,7 @@
   
       my $status = APR::EMISMATCH;
   
  -    my $str = APR::strerror($status);
  +    my $str = APR::Error::strerror($status);
   
       t_debug "strerror=$str\n";
   
  
  
  
  1.22      +12 -12    modperl-2.0/xs/modperl_xs_util.h
  
  Index: modperl_xs_util.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/modperl_xs_util.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -u -r1.21 -r1.22
  --- modperl_xs_util.h 27 Apr 2004 18:45:12 -0000      1.21
  +++ modperl_xs_util.h 4 May 2004 06:19:12 -0000       1.22
  @@ -95,18 +95,18 @@
       arg = *MARK++
   
   /* XXX: we probably shouldn't croak here */
  -#define mpxs_write_loop(func, obj)                       \
  -    while (MARK <= SP) {                                 \
  -        apr_size_t wlen;                                 \
  -        apr_status_t rv;                                 \
  -        char *buf = SvPV(*MARK, wlen);                   \
  -        MP_TRACE_o(MP_FUNC, "%d bytes [%s]", wlen, buf); \
  -        rv = func(aTHX_ obj, buf, &wlen);                \
  -        if (rv != APR_SUCCESS) {                         \
  -            Perl_croak(aTHX_ modperl_apr_strerror(rv));  \
  -        }                                                \
  -        bytes += wlen;                                   \
  -        MARK++;                                          \
  +#define mpxs_write_loop(func, obj)                              \
  +    while (MARK <= SP) {                                        \
  +        apr_size_t wlen;                                        \
  +        apr_status_t rv;                                        \
  +        char *buf = SvPV(*MARK, wlen);                          \
  +        MP_TRACE_o(MP_FUNC, "%d bytes [%s]", wlen, buf);        \
  +        rv = func(aTHX_ obj, buf, &wlen);                       \
  +        if (rv != APR_SUCCESS) {                                \
  +            Perl_croak(aTHX_ modperl_error_strerror(aTHX_ rv)); \
  +        }                                                       \
  +        bytes += wlen;                                          \
  +        MARK++;                                                 \
       }
   
   #endif /* MODPERL_XS_H */
  
  
  
  1.38      +1 -1      modperl-2.0/xs/APR/PerlIO/apr_perlio.c
  
  Index: apr_perlio.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/APR/PerlIO/apr_perlio.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -u -r1.37 -r1.38
  --- apr_perlio.c      4 Mar 2004 06:01:10 -0000       1.37
  +++ apr_perlio.c      4 May 2004 06:19:12 -0000       1.38
  @@ -198,7 +198,7 @@
       }
       else if (rc != APR_SUCCESS) {
           Perl_croak(aTHX_ "failed to read from file: %s",
  -                   modperl_apr_strerror(rc));
  +                   modperl_error_strerror(aTHX_ rc));
       }
   
       return count;
  
  
  
  1.5       +0 -18     modperl-2.0/xs/APR/Util/APR__Util.h
  
  Index: APR__Util.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/APR/Util/APR__Util.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- APR__Util.h       4 Mar 2004 06:01:10 -0000       1.4
  +++ APR__Util.h       4 May 2004 06:19:12 -0000       1.5
  @@ -18,21 +18,3 @@
   {
       return apr_password_validate(passwd, hash) == APR_SUCCESS;
   }
  -
  -static MP_INLINE void mpxs_apr_strerror(pTHX_ SV *sv, SV *arg)
  -{
  -    apr_status_t statcode = mp_xs_sv2_status(arg);
  -    char *ptr;
  -    mpxs_sv_grow(sv, 128-1);
  -    ptr = apr_strerror(statcode, SvPVX(sv), SvLEN(sv));
  -    mpxs_sv_cur_set(sv, strlen(ptr)); /*XXX*/
  -}
  -
  -static XS(MPXS_apr_strerror)
  -{
  -    dXSARGS;
  -
  -    mpxs_usage_items_1("status_code");
  -
  -    mpxs_set_targ(mpxs_apr_strerror, ST(0));
  -}
  
  
  

Reply via email to