httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject cvs commit: httpd-2.0/server core.c request.c
Date Mon, 21 Jan 2002 01:43:30 GMT
ianh        02/01/20 17:43:30

  Modified:    .        CHANGES
               modules/filters mod_include.c
               server   core.c request.c
  Log:
  These changes are to allow caching of subrequests via a quick_handler.
  
  * Change SUBREQ_CORE so that it is a HTTP_HEADER (20) filter instead of a content filter
(10)
    this allows subrequests to add content filters properly
  
  * Change subreq handling of 'handle-include' so that it splits/passes the brigade before
the subreq
    is created. (This allows quick_handler to push content back from this phase)
  
  Revision  Changes    Path
  1.530     +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.529
  retrieving revision 1.530
  diff -u -r1.529 -r1.530
  --- CHANGES	20 Jan 2002 06:49:20 -0000	1.529
  +++ CHANGES	21 Jan 2002 01:43:30 -0000	1.530
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0.31-dev
  +  *) Change in quick_hanlder behavior for subrequests. it now passes DONE
  +     (as it does for a normal request). quick_handled sub-requests now work
  +     in mod-include [Ian Holsman]
  +
  +  *) Change SUBREQ_CORE so that it is a 'HTTP_HEADER' filter instead of
  +     'CONTENT' one, as it needs to run AFTER all content headers
   
     *) Rename BeOS MPM directive RequestsPerThread to MaxRequestsPerThread.
        [Lars Eilebrecht]
  
  
  
  1.188     +13 -8     httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.187
  retrieving revision 1.188
  diff -u -r1.187 -r1.188
  --- mod_include.c	18 Jan 2002 21:38:12 -0000	1.187
  +++ mod_include.c	21 Jan 2002 01:43:30 -0000	1.188
  @@ -1128,6 +1128,7 @@
       apr_bucket  *tmp_buck;
       char *parsed_string;
       int loglevel = APLOG_ERR;
  +    int quick_handler = 0;
   
       *inserted_head = NULL;
       if (ctx->flags & FLAG_PRINTING) {
  @@ -1144,7 +1145,13 @@
               if (!strcmp(tag, "virtual") || !strcmp(tag, "file")) {
                   request_rec *rr = NULL;
                   char *error_fmt = NULL;
  +                apr_status_t rc = APR_SUCCESS;
   
  +                SPLIT_AND_PASS_PRETAG_BUCKETS(*bb, ctx, f->next, rc);
  +                if (rc != APR_SUCCESS) {
  +                    return rc;
  +                }
  + 
                   parsed_string = ap_ssi_parse_string(r, ctx, tag_val, NULL, 
                                                       MAX_STRING_LEN, 0);
                   if (tag[0] == 'f') {
  @@ -1162,6 +1169,10 @@
                   else {
                       rr = ap_sub_req_lookup_uri(parsed_string, r, f->next);
                   }
  +                if (rr && rr->status == DONE) {
  +                    rr->status = HTTP_OK;
  +                    quick_handler = 1;
  +                }
   
                   if (!error_fmt && rr->status != HTTP_OK) {
                       error_fmt = "unable to include \"%s\" in parsed file %s";
  @@ -1227,14 +1238,8 @@
   
                   if (!error_fmt) {
                       int rv;
  -                    apr_status_t rc = APR_SUCCESS;
  -
  -                    SPLIT_AND_PASS_PRETAG_BUCKETS(*bb, ctx, f->next, rc);
  -                    if (rc != APR_SUCCESS) {
  -                        return rc;
  -                    }
  -                    
  -                    if ((rv = ap_run_sub_req(rr))) {
  +                   
  +                    if ((quick_handler==0)&&(rv = ap_run_sub_req(rr))) {
                           if (APR_STATUS_IS_EPIPE(rv)) {
                               /* let's not clutter the log on a busy server */
                               loglevel = APLOG_INFO; 
  
  
  
  1.134     +1 -1      httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- core.c	20 Jan 2002 11:43:37 -0000	1.133
  +++ core.c	21 Jan 2002 01:43:30 -0000	1.134
  @@ -3684,7 +3684,7 @@
                                 AP_FTYPE_HTTP_HEADER);
       ap_register_output_filter("CORE", core_output_filter, AP_FTYPE_NETWORK);
       ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, 
  -                              AP_FTYPE_CONTENT);
  +                              AP_FTYPE_HTTP_HEADER);
       ap_old_write_func = ap_register_output_filter("OLD_WRITE", 
                                      ap_old_write_filter, AP_FTYPE_CONTENT - 10);
   }
  
  
  
  1.94      +1 -4      httpd-2.0/server/request.c
  
  Index: request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/request.c,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- request.c	16 Jan 2002 19:14:44 -0000	1.93
  +++ request.c	21 Jan 2002 01:43:30 -0000	1.94
  @@ -146,10 +146,7 @@
       access_status = ap_run_quick_handler(r);
       if (access_status != DECLINED) {
           if (access_status == OK) {
  -            if (!r->main)
  -                return DONE;
  -            else
  -                return OK;
  +            return DONE;
           }
           else  {
               return access_status;
  
  
  

Mime
View raw message