dougm       01/06/13 21:36:22

  Modified:    .        Changes
               t/net/perl api.pl
               src/modules/perl Apache.xs
  Log:
  $r->custom_response($code, undef) will now unset the current CustomResponse
  
  Revision  Changes    Path
  1.595     +3 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.594
  retrieving revision 1.595
  diff -u -r1.594 -r1.595
  --- Changes   2001/06/13 21:27:45     1.594
  +++ Changes   2001/06/14 04:36:18     1.595
  @@ -10,6 +10,9 @@
   
   =item 1.25_01-dev
   
  +$r->custom_response($code, undef) will now unset the current CustomResponse
  +[Geoffrey Young <[EMAIL PROTECTED]>]
  +
   fix to compile with sfio+ithreads, thanks to Joe Schaefer for the spot
   
   win32 fixes for apache 1.3.20 [Randy Kobes <[EMAIL PROTECTED]>]
  
  
  
  1.46      +3 -1      modperl/t/net/perl/api.pl
  
  Index: api.pl
  ===================================================================
  RCS file: /home/cvs/modperl/t/net/perl/api.pl,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- api.pl    2001/05/01 17:28:41     1.45
  +++ api.pl    2001/06/14 04:36:20     1.46
  @@ -20,7 +20,7 @@
   my $is_win32 = WIN32;
   $tests += 2 unless $is_win32;
   my $test_get_set = Apache->can('set_handlers') && ($tests += 4);
  -my $test_custom_response = (MODULE_MAGIC_NUMBER >= 19980324) && ($tests += 2);
  +my $test_custom_response = (MODULE_MAGIC_NUMBER >= 19980324) && ($tests += 4);
   my $test_dir_config = $INC{'Apache/TestDirectives.pm'} && ($tests += 9);
   
   my $i;
  @@ -217,6 +217,8 @@
   if($test_custom_response) {
       test ++$i, $r->custom_response(403, "no chance") || 1;
       test ++$i, $r->custom_response(403) =~ /chance/;
  +    test ++$i, $r->custom_response(403, undef) || 1;
  +    test ++$i, not defined $r->custom_response(403);
   }
   
   if($test_get_set) {
  
  
  
  1.122     +11 -2     modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===================================================================
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- Apache.xs 2001/05/01 17:28:37     1.121
  +++ Apache.xs 2001/06/14 04:36:21     1.122
  @@ -238,7 +238,7 @@
   }
   #endif
   
  -static char *custom_response(request_rec *r, int status, char *string)
  +static char *custom_response(request_rec *r, int status, char *string, int reset)
   {
       core_dir_config *conf = (core_dir_config *)
        get_module_config(r->per_dir_config, &core_module);
  @@ -254,7 +254,10 @@
   
       idx = index_of_response(status);
       retval = conf->response_code_strings[idx];
  -    if (string) {
  +    if (reset) {
  +        conf->response_code_strings[idx] = NULL;
  +    }
  +    else if (string) {
        conf->response_code_strings[idx] = 
            ((is_url(string) || (*string == '/')) && (*string != '"')) ? 
                pstrdup(r->pool, string) : pstrcat(r->pool, "\"", string, NULL);
  @@ -751,6 +754,12 @@
       Apache     r
       int status
       char *string
  +   
  +    CODE:
  +    RETVAL = custom_response(r, status, string, ST(2) == &sv_undef);
  +
  +    OUTPUT:
  +    RETVAL
       
   int
   satisfies(r)
  
  
  

Reply via email to