perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/xs/maps modperl_functions.map
Date Mon, 30 Apr 2001 04:39:30 GMT
dougm       01/04/29 21:39:30

  Modified:    t/conf   modperl_extra.pl
               t/response/TestAPI request_rec.pm
               xs/Apache/RequestUtil Apache__RequestUtil.h
               xs/maps  modperl_functions.map
  Log:
  add Apache->request method and tests
  
  Revision  Changes    Path
  1.6       +1 -0      modperl-2.0/t/conf/modperl_extra.pl
  
  Index: modperl_extra.pl
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- modperl_extra.pl	2001/04/19 21:26:38	1.5
  +++ modperl_extra.pl	2001/04/30 04:39:24	1.6
  @@ -1,5 +1,6 @@
   use Apache::RequestRec ();
   use Apache::RequestIO ();
  +use Apache::RequestUtil ();
   
   use Apache::Server ();
   use Apache::Connection ();
  
  
  
  1.3       +16 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- request_rec.pm	2001/04/03 16:59:09	1.2
  +++ request_rec.pm	2001/04/30 04:39:26	1.3
  @@ -8,8 +8,21 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 33;
  +    plan $r, tests => 35;
   
  +    #Apache->request($r); #PerlOptions +GlobalRequest takes care
  +    my $gr = Apache->request;
  +
  +    ok $$gr == $$r;
  +
  +    my $newr = Apache::RequestRec->new($r->connection, $r->pool);
  +    Apache->request($newr);
  +    $gr = Apache->request;
  +
  +    ok $$gr == $$newr;
  +
  +    Apache->request($r);
  +
       ok $r->pool->isa('APR::Pool');
   
       ok $r->connection->isa('Apache::Connection');
  @@ -101,3 +114,5 @@
   }
   
   1;
  +__END__
  +PerlOptions +GlobalRequest
  
  
  
  1.5       +20 -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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Apache__RequestUtil.h	2001/04/28 22:42:55	1.4
  +++ Apache__RequestUtil.h	2001/04/30 04:39:27	1.5
  @@ -80,7 +80,27 @@
       r->err_headers_out = apr_table_make(p, 1);
       r->notes = apr_table_make(p, 1);
   
  +    ap_run_create_request(r);
  +
       return r;
  +}
  +
  +static MP_INLINE
  +request_rec *mpxs_Apache_request(SV *classname, SV *svr)
  +{
  +    request_rec *cur;
  +    apr_status_t status = modperl_tls_get_request_rec(&cur);
  +
  +    if (status != APR_SUCCESS) {
  +        /* XXX: croak */
  +    }
  +
  +    if (svr) {
  +        dTHX; /*XXX*/
  +        modperl_global_request_obj_set(aTHX_ svr);
  +    }
  +
  +    return cur;
   }
   
   static MP_INLINE
  
  
  
  1.9       +2 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_functions.map	2001/04/28 22:42:56	1.8
  +++ modperl_functions.map	2001/04/30 04:39:29	1.9
  @@ -10,6 +10,8 @@
    mpxs_Apache__RequestRec_set_basic_credentials
   PACKAGE=Apache::RequestRec
    mpxs_Apache__RequestRec_new | | classname, c, base_pool=NULL
  +PACKAGE=Apache
  + mpxs_Apache_request | | classname, svr=Nullsv
   
   MODULE=Apache::RequestIO   PACKAGE=Apache::RequestRec
    SV *:DEFINE_TIEHANDLE   | | SV *:stashsv, SV *:sv=Nullsv
  
  
  

Mime
View raw message