gozer       2004/10/04 12:27:38

  Modified:    .        Changes
               t/response/TestAPI request_util.pm
               todo     release
               xs/Apache/RequestUtil Apache__RequestUtil.h
               xs/maps  apache_functions.map modperl_functions.map
               xs/tables/current/ModPerl FunctionTable.pm
  Log:
  $r->document_root can now be changed when safe to do so
  
  Revision  Changes    Path
  1.508     +2 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.507
  retrieving revision 1.508
  diff -u -r1.507 -r1.508
  --- Changes   4 Oct 2004 02:29:26 -0000       1.507
  +++ Changes   4 Oct 2004 19:27:37 -0000       1.508
  @@ -12,6 +12,8 @@
   
   =item 1.99_17-dev
   
  +$r->document_root can now be changed when safe to do so [Gozer]
  +
   APR::Bucket->new now requires an APR::BucketAlloc as its first argument.
   New subs added: APR::Bucket::setaside, APR::Bucket::alloc_create,
   APR::Bucket::alloc_destroy, APR::Brigade::bucket_alloc. [joes]
  
  
  
  1.2       +16 -2     modperl-2.0/t/response/TestAPI/request_util.pm
  
  Index: request_util.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_util.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- request_util.pm   15 Jul 2004 21:35:48 -0000      1.1
  +++ request_util.pm   4 Oct 2004 19:27:37 -0000       1.2
  @@ -7,6 +7,7 @@
   use Apache::TestUtil;
   
   use Apache::RequestUtil ();
  +use Apache::MPM ();
   
   use Apache::Const -compile => 'OK';
   
  @@ -19,12 +20,25 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => (scalar keys %status_lines) + 8;
  +    plan $r, tests => (scalar keys %status_lines) + 10;
   
       ok $r->default_type;
   
  -    ok $r->document_root;
  +    my $document_root = $r->document_root;
   
  +    ok $document_root;
  +    
  +    if (!Apache::MPM->is_threaded) {
  +        ok t_cmp($document_root, $r->document_root('/tmp/foo'));
  +        ok t_cmp('/tmp/foo', $r->document_root($document_root));
  +    }
  +    else {
  +        eval { $r->document_root('/tmp/foo') };
  +        ok t_cmp($@, qr/Can't run.*in the threaded env/, 
  +                 "document_root is read-only under threads");
  +        ok 1;
  +    }
  +    
       ok $r->get_server_name;
   
       ok $r->get_server_port;
  
  
  
  1.66      +0 -7      modperl-2.0/todo/release
  
  Index: release
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/todo/release,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- release   4 Oct 2004 02:16:42 -0000       1.65
  +++ release   4 Oct 2004 19:27:37 -0000       1.66
  @@ -9,13 +9,6 @@
     will know exactly once libapr is fixed
     owner: stas
   
  -* $r->document_root:
  -  cannot currently be modified.  requires locking since it is part of
  -  the per-server config structure which is shared between threads
  -  but even w/o locking one thread is not allowed to affect other
  -  threads with this change, so it's out of question to make this
  -  method set-able for threaded after the startup item
  -
   * $r->child_terminate:
     - a must to be able to port Apache::SizeLimit, which is a
       showstopper for many mp1 users wanting to move to mp2.
  
  
  
  1.26      +16 -0     modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h
  
  Index: Apache__RequestUtil.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Apache__RequestUtil.h     18 Aug 2004 05:52:22 -0000      1.25
  +++ Apache__RequestUtil.h     4 Oct 2004 19:27:37 -0000       1.26
  @@ -299,3 +299,19 @@
       }
   }
   
  +static MP_INLINE
  +const char *mpxs_Apache__RequestRec_document_root(pTHX_ request_rec *r,
  +                                                  SV *new_root)
  +{
  +    const char *retval = ap_document_root(r);
  +    
  +    if (new_root) {
  +        MP_CROAK_IF_THREADS_STARTED("setting $r->document_root");
  +        core_server_config *conf = 
  +            ap_get_module_config(r->server->module_config, 
  +                                 &core_module);
  +        conf->ap_document_root = SvPV_nolen(new_root);
  +    }
  +
  +    return retval;
  +}
  
  
  
  1.105     +1 -1      modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- apache_functions.map      17 Sep 2004 00:07:24 -0000      1.104
  +++ apache_functions.map      4 Oct 2004 19:27:37 -0000       1.105
  @@ -55,7 +55,7 @@
   ~ap_set_content_type
   
   #MODULE=Apache::RequestConfig
  - ap_document_root
  +~ap_document_root
    ap_get_limit_req_body
   ?ap_get_limit_xml_body
   >ap_core_translate
  
  
  
  1.90      +1 -0      modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- modperl_functions.map     24 Sep 2004 19:55:35 -0000      1.89
  +++ modperl_functions.map     4 Oct 2004 19:27:37 -0000       1.90
  @@ -31,6 +31,7 @@
    mpxs_Apache__RequestRec_as_string
    mpxs_Apache__RequestRec_pnotes | | r, key=Nullsv, val=Nullsv
    mpxs_Apache__RequestRec_add_config | | r, lines, override=OR_AUTHCFG 
  + mpxs_Apache__RequestRec_document_root | | r, new_root=Nullsv
   
    #protocol module helpers
    mpxs_Apache__RequestRec_location_merge
  
  
  
  1.187     +20 -2     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.186
  retrieving revision 1.187
  diff -u -r1.186 -r1.187
  --- FunctionTable.pm  4 Oct 2004 02:16:43 -0000       1.186
  +++ FunctionTable.pm  4 Oct 2004 19:27:37 -0000       1.187
  @@ -1,8 +1,8 @@
   package ModPerl::FunctionTable;
   
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -# ! WARNING: generated by ModPerl::ParseSource/0.010
  -# !          Wed Sep 22 14:01:12 2004
  +# ! WARNING: generated by ModPerl::ParseSource/0.01
  +# !          Wed Sep 29 16:02:04 2004
   # !          do NOT edit, any changes will be lost !
   # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   
  @@ -6412,6 +6412,24 @@
         {
           'type' => 'SV *',
           'name' => 'type'
  +      }
  +    ]
  +  },
  +  {
  +    'return_type' => 'const char *',
  +    'name' => 'mpxs_Apache__RequestRec_document_root',
  +    'args' => [
  +      {
  +        'type' => 'PerlInterpreter *',
  +        'name' => 'my_perl'
  +      },
  +      {
  +        'type' => 'request_rec *',
  +        'name' => 'r'
  +      },
  +      {
  +        'type' => 'SV *',
  +        'name' => 'new_root'
         }
       ]
     },
  
  
  

Reply via email to