stas        01/10/28 17:19:16

  Modified:    src/modules/perl modperl_config.c
               t/response/TestAPI request_rec.pm
               todo     api.txt
               xs/Apache/RequestUtil Apache__RequestUtil.h
               xs/maps  modperl_functions.map
  Log:
  - implement $r->location
  
  Revision  Changes    Path
  1.45      +4 -0      modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- modperl_config.c  2001/10/22 17:20:11     1.44
  +++ modperl_config.c  2001/10/29 01:19:16     1.45
  @@ -4,6 +4,8 @@
   {
       modperl_config_dir_t *dcfg = modperl_config_dir_new(p);
   
  +    dcfg->location = dir;
  +    
   #ifdef USE_ITHREADS
       /* defaults to per-server scope */
       dcfg->interp_scope = MP_INTERP_SCOPE_UNDEF;
  @@ -60,6 +62,8 @@
   
       mrg->flags = modperl_options_merge(p, base->flags, add->flags);
   
  +    merge_item(location);
  +    
       merge_table_overlap_item(SetVar);
   
       /* XXX: check if Perl*Handler is disabled */
  
  
  
  1.9       +5 -1      modperl-2.0/t/response/TestAPI/request_rec.pm
  
  Index: request_rec.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- request_rec.pm    2001/09/28 20:11:02     1.8
  +++ request_rec.pm    2001/10/29 01:19:16     1.9
  @@ -11,7 +11,7 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 48;
  +    plan $r, tests => 49;
   
       #Apache->request($r); #PerlOptions +GlobalRequest takes care
       my $gr = Apache->request;
  @@ -181,6 +181,10 @@
       ok $r->uri;
   
       ok $r->filename;
  +
  +    ok t_cmp('/' . __PACKAGE__,
  +             $r->location,
  +             "location");
   
       my $mtime = (stat __FILE__)[9];
       $r->mtime($mtime);
  
  
  
  1.12      +0 -3      modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- api.txt   2001/10/09 00:14:10     1.11
  +++ api.txt   2001/10/29 01:19:16     1.12
  @@ -85,9 +85,6 @@
   Apache->httpd_conf:
   depends on <Perl> sections
   
  -$r->location:
  -not yet implemented
  -
   Apache->request:
   need to deal with subclass objects which are not a request_rec
   (e.g. HASH ref)
  
  
  
  1.8       +17 -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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Apache__RequestUtil.h     2001/09/28 20:11:02     1.7
  +++ Apache__RequestUtil.h     2001/10/29 01:19:16     1.8
  @@ -179,3 +179,20 @@
   
   #define mpxs_Apache__RequestRec_dir_config(r, key, sv_val) \
       modperl_dir_config(aTHX_ r, r->server, key, sv_val)
  +
  +static MP_INLINE
  +SV *mpxs_Apache__RequestRec_location(request_rec *r)
  +{
  +    dTHX; /* XXX */
  +
  +    if (r->per_dir_config) {                            
  +        MP_dDCFG;
  +        char *location;
  +        
  +        if ((location = dcfg->location)) {
  +            return newSVpv(location, 0); 
  +        }
  +    }
  +    
  +    return &PL_sv_undef;
  +}
  
  
  
  1.25      +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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- modperl_functions.map     2001/10/09 18:01:21     1.24
  +++ modperl_functions.map     2001/10/29 01:19:16     1.25
  @@ -12,6 +12,7 @@
    mpxs_Apache__RequestRec_push_handlers
    mpxs_Apache__RequestRec_set_handlers
    mpxs_Apache__RequestRec_get_handlers
  + mpxs_Apache__RequestRec_location
   
    #protocol module helpers
    mpxs_Apache__RequestRec_location_merge
  
  
  


Reply via email to