stas        2004/08/15 13:06:51

  Modified:    src/modules/perl modperl_handler.c modperl_util.c
                        modperl_util.h
               t/error  syntax.t
               t/response/TestError syntax.pm
               .        Changes
  Log:
  combine handler resolving failure error with the actual error, so
  there is only one logged entry
  
  Revision  Changes    Path
  1.28      +3 -3      modperl-2.0/src/modules/perl/modperl_handler.c
  
  Index: modperl_handler.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -u -r1.27 -r1.28
  --- modperl_handler.c 2 Apr 2004 02:17:45 -0000       1.27
  +++ modperl_handler.c 15 Aug 2004 20:06:51 -0000      1.28
  @@ -130,9 +130,9 @@
                      (unsigned long)rp);
   
           if (!modperl_mgv_resolve(aTHX_ handler, rp, handler->name, FALSE)) {
  -            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, 
  -                         "failed to resolve handler `%s'",
  -                         handler->name);
  +            modperl_errsv_prepend(aTHX_
  +                                  "failed to resolve handler `%s': ",
  +                                  handler->name);
               return HTTP_INTERNAL_SERVER_ERROR;
           }
       }
  
  
  
  1.75      +16 -0     modperl-2.0/src/modules/perl/modperl_util.c
  
  Index: modperl_util.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -u -r1.74 -r1.75
  --- modperl_util.c    16 Jul 2004 01:10:45 -0000      1.74
  +++ modperl_util.c    15 Aug 2004 20:06:51 -0000      1.75
  @@ -208,6 +208,22 @@
       return status;
   }
   
  +/* prepends the passed sprintf-like arguments to ERRSV, which also
  + * gets stringified on the way */
  +void modperl_errsv_prepend(pTHX_ const char *pat, ...)
  +{
  +    SV *sv;
  +    va_list args;
  +
  +    va_start(args, pat);
  +    sv = vnewSVpvf(pat, &args);
  +    va_end(args);
  +
  +    sv_catsv(sv, ERRSV);
  +    sv_copypv(ERRSV, sv);
  +    sv_free(sv);
  +}
  +
   #define dl_librefs "DynaLoader::dl_librefs"
   #define dl_modules "DynaLoader::dl_modules"
   
  
  
  
  1.65      +2 -0      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.64
  retrieving revision 1.65
  diff -u -u -r1.64 -r1.65
  --- modperl_util.h    16 Jul 2004 01:10:45 -0000      1.64
  +++ modperl_util.h    15 Aug 2004 20:06:51 -0000      1.65
  @@ -47,6 +47,8 @@
   
   int modperl_errsv(pTHX_ int status, request_rec *r, server_rec *s);
   
  +void modperl_errsv_prepend(pTHX_ const char *pat, ...);
  +
   int modperl_require_module(pTHX_ const char *pv, int logfailure);
   int modperl_require_file(pTHX_ const char *pv, int logfailure);
   
  
  
  
  1.4       +1 -0      modperl-2.0/t/error/syntax.t
  
  Index: syntax.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/error/syntax.t,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- syntax.t  9 Jul 2004 15:36:13 -0000       1.3
  +++ syntax.t  15 Aug 2004 20:06:51 -0000      1.4
  @@ -10,6 +10,7 @@
   my $location = "/TestError__syntax";
   my $res = GET($location);
   #t_debug($res->content);
  +t_client_log_error_is_expected();
   ok t_cmp(
       $res->code,
       500,
  
  
  
  1.4       +0 -5      modperl-2.0/t/response/TestError/syntax.pm
  
  Index: syntax.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestError/syntax.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -u -r1.3 -r1.4
  --- syntax.pm 28 May 2004 01:33:54 -0000      1.3
  +++ syntax.pm 15 Aug 2004 20:06:51 -0000      1.4
  @@ -1,10 +1,5 @@
   package TestError::syntax;
   
  -BEGIN {
  -    use Apache::TestUtil;
  -    t_server_log_error_is_expected(2);
  -}
  -
   use strict;
   use warnings FATAL => 'all';
   
  
  
  
  1.448     +3 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.447
  retrieving revision 1.448
  diff -u -u -r1.447 -r1.448
  --- Changes   15 Aug 2004 10:08:30 -0000      1.447
  +++ Changes   15 Aug 2004 20:06:51 -0000      1.448
  @@ -12,6 +12,9 @@
   
   =item 1.99_15-dev
   
  +combine handler resolving failure error with the actual error, so
  +there is only one logged entry [Stas]
  +
   pod manpages are now glued to all .pm files for which .pod exists
   [Stas]
   
  
  
  

Reply via email to