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/Apache/RequestIO Apache__RequestIO.h
Date Sun, 06 Jan 2002 20:45:36 GMT
dougm       02/01/06 12:45:36

  Modified:    src/modules/perl mod_perl.c modperl_config.c modperl_types.h
               xs/Apache/RequestIO Apache__RequestIO.h
  Log:
  share output buffer (modperl_wbucket_t) across subrequests
  
  Revision  Changes    Path
  1.101     +19 -9     modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- mod_perl.c	23 Dec 2001 05:46:29 -0000	1.100
  +++ mod_perl.c	6 Jan 2002 20:45:35 -0000	1.101
  @@ -433,7 +433,13 @@
       if (r->main) {
           modperl_config_req_t *main_rcfg =
               modperl_config_req_get(r->main);
  -        modperl_wbucket_flush(&main_rcfg->wbucket);
  +
  +        rcfg->wbucket = main_rcfg->wbucket;
  +    }
  +    else {
  +        rcfg->wbucket =
  +            (modperl_wbucket_t *)apr_palloc(r->pool,
  +                                            sizeof(*rcfg->wbucket));
       }
   
       return OK;
  @@ -553,11 +559,19 @@
   void modperl_response_init(request_rec *r)
   {
       MP_dRCFG;
  +    MP_dDCFG;
  +    modperl_wbucket_t *wb = rcfg->wbucket;
  +
  +    if (r->main) {
  +        return;
  +    }
   
       /* setup buffer for output */
  -    rcfg->wbucket.pool = r->pool;
  -    rcfg->wbucket.filters = &r->output_filters;
  -    rcfg->wbucket.outcnt = 0;
  +    wb->pool = r->pool;
  +    wb->filters = &r->output_filters;
  +    wb->outcnt = 0;
  +    wb->header_parse = MpDirPARSE_HEADERS(dcfg) ? 1 : 0;
  +    wb->r = r;
   }
   
   void modperl_response_finish(request_rec *r)
  @@ -565,7 +579,7 @@
       MP_dRCFG;
   
       /* flush output buffer */
  -    modperl_wbucket_flush(&rcfg->wbucket);
  +    modperl_wbucket_flush(rcfg->wbucket);
   }
   
   static int modperl_response_handler_run(request_rec *r, int finish)
  @@ -624,10 +638,6 @@
       /* default is +SetupEnv, skip if PerlOption -SetupEnv */
       if (MpDirSETUP_ENV(dcfg) || !MpDirSeenSETUP_ENV(dcfg)) {
           modperl_env_request_populate(aTHX_ r);
  -    }
  -
  -    if (MpDirPARSE_HEADERS(dcfg)) {
  -        rcfg->wbucket.header_parse = 1;
       }
   
       h_stdout = modperl_io_tie_stdout(aTHX_ r);
  
  
  
  1.52      +0 -2      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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- modperl_config.c	20 Nov 2001 02:39:02 -0000	1.51
  +++ modperl_config.c	6 Jan 2002 20:45:36 -0000	1.52
  @@ -88,8 +88,6 @@
       modperl_config_req_t *rcfg = 
           (modperl_config_req_t *)apr_pcalloc(r->pool, sizeof(*rcfg));
   
  -    rcfg->wbucket.r = r;
  -
       MP_TRACE_d(MP_FUNC, "0x%lx\n", (unsigned long)rcfg);
   
       return rcfg;
  
  
  
  1.55      +1 -1      modperl-2.0/src/modules/perl/modperl_types.h
  
  Index: modperl_types.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- modperl_types.h	19 Nov 2001 00:07:28 -0000	1.54
  +++ modperl_types.h	6 Jan 2002 20:45:36 -0000	1.55
  @@ -205,7 +205,7 @@
       HV *pnotes;
       SV *global_request_obj;
       U8 flags;
  -    modperl_wbucket_t wbucket;
  +    modperl_wbucket_t *wbucket;
       MpAV *handlers_per_dir[MP_HANDLER_NUM_PER_DIR];
       MpAV *handlers_per_srv[MP_HANDLER_NUM_PER_SRV];
       modperl_perl_globals_t perl_globals;
  
  
  
  1.24      +5 -5      modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h
  
  Index: Apache__RequestIO.h
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestIO/Apache__RequestIO.h,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Apache__RequestIO.h	20 Dec 2001 18:12:15 -0000	1.23
  +++ Apache__RequestIO.h	6 Jan 2002 20:45:36 -0000	1.24
  @@ -9,7 +9,7 @@
   #define mpxs_output_flush(r, rcfg) \
       /* if ($|) */ \
       if (IoFLUSH(PL_defoutgv)) { \
  -        modperl_wbucket_flush(&rcfg->wbucket); \
  +        modperl_wbucket_flush(rcfg->wbucket); \
           ap_rflush(r); \
       }
   
  @@ -27,7 +27,7 @@
   
       MP_START_TIMES();
   
  -    mpxs_write_loop(modperl_wbucket_write, &rcfg->wbucket);
  +    mpxs_write_loop(modperl_wbucket_write, rcfg->wbucket);
   
       MP_END_TIMES();
       MP_PRINT_TIMES("r->puts");
  @@ -54,7 +54,7 @@
       
       rcfg = modperl_config_req_get(r);
       
  -    mpxs_write_loop(modperl_wbucket_write, &rcfg->wbucket);
  +    mpxs_write_loop(modperl_wbucket_write, rcfg->wbucket);
       
       mpxs_output_flush(r, rcfg);
       
  @@ -80,7 +80,7 @@
       modperl_perl_do_sprintf(aTHX_ sv, items, MARK);
       bytes = SvCUR(sv);
   
  -    modperl_wbucket_write(&rcfg->wbucket, SvPVX(sv), &bytes);
  +    modperl_wbucket_write(rcfg->wbucket, SvPVX(sv), &bytes);
       
       mpxs_output_flush(r, rcfg);
   
  @@ -112,7 +112,7 @@
           wlen = bufsiz;
       }
   
  -    modperl_wbucket_write(&rcfg->wbucket, buf+offset, &wlen);
  +    modperl_wbucket_write(rcfg->wbucket, buf+offset, &wlen);
   
       return wlen;
   }
  
  
  

Mime
View raw message