]> granicus.if.org Git - apache/commitdiff
These changes are to allow caching of subrequests via a quick_handler.
authorIan Holsman <ianh@apache.org>
Mon, 21 Jan 2002 01:43:30 +0000 (01:43 +0000)
committerIan Holsman <ianh@apache.org>
Mon, 21 Jan 2002 01:43:30 +0000 (01:43 +0000)
* 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)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92956 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_include.c
server/core.c
server/request.c

diff --git a/CHANGES b/CHANGES
index 4e581a514bac9f2f296e2e14bbe0814de87484f7..02439d6146d18a54e0b48a297b733aba39d82d7f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -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]
index 0d966d0f6b2bd24b85ff81bddafa8d5436481a42..6d0cc45106cb90f164360614e863342f52af8137 100644 (file)
@@ -1128,6 +1128,7 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb,
     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 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb,
             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 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb,
                 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 @@ static int handle_include(include_ctx_t *ctx, apr_bucket_brigade **bb,
 
                 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; 
index 713c2716ec8e83c9cf3710a86cb746ab40768774..d76dc77d66f1609ead0b24e21bac793e295f9c9f 100644 (file)
@@ -3684,7 +3684,7 @@ static void register_hooks(apr_pool_t *p)
                               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);
 }
index 52bb3a38322783a50038de5ee4c39096cbe1dfaf..99db38454a8936ac978f866aa5c53606b5479a4b 100644 (file)
@@ -146,10 +146,7 @@ AP_DECLARE(int) ap_process_request_internal(request_rec *r)
     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;