Cliff Woolley < mailto:[EMAIL PROTECTED]> wrote:

> On Tue, 13 Nov 2001, Ryan Bloom wrote:
>
> > We are talking about destroying the sub request.  By the time this is
> > done, we have already passed all of the data from the sub-requests
> > filter stack to the original requests.  Either all of the data was
> > written to the network, or it was set-aside.  If it was written to the
> > network, we can ignore it.  If it was set aside, then it was done so
> > in the original request, so we passed r->pool or c->pool to the
> > setaside function.
>
> [thinks for a minute] Yeah, that does sound right.  Bottom line is that
> core_output_filter is (or should be) taking care of all this for us.
> Okay, +1.
>

Here's a patch that destroys the subrequest
--Brian


Index: modules/filters/mod_include.h
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/filters/mod_include.h,v
retrieving revision 1.24
diff -u -r1.24 mod_include.h
--- modules/filters/mod_include.h       2001/11/12 03:23:12     1.24
+++ modules/filters/mod_include.h       2001/11/14 06:44:21
@@ -75,9 +75,6 @@
 #define RAW_ASCII_CHAR(ch)  (ch)
 #endif /*APR_CHARSET_EBCDIC*/
 
-/* just need some arbitrary non-NULL pointer which can't also be a request_rec */
-#define NESTED_INCLUDE_MAGIC   (&include_module)
-
 /****************************************************************************
  * Used to keep context information during parsing of a request for SSI tags.
  * This is especially useful if the tag stretches across multiple buckets or
Index: modules/filters/mod_include.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/filters/mod_include.c,v
retrieving revision 1.153
diff -u -r1.153 mod_include.c
--- modules/filters/mod_include.c       2001/11/12 03:23:12     1.153
+++ modules/filters/mod_include.c       2001/11/14 06:44:23
@@ -1126,11 +1126,8 @@
                                         *inserted_head);
                 }
 
-                /* destroy the sub request if it's not a nested include 
-                 * (crumb) */
-                if (rr != NULL
-                    && ap_get_module_config(rr->request_config, 
-                       &include_module) != NESTED_INCLUDE_MAGIC) {
+                /* destroy the sub request */
+                if (rr != NULL) {
                     ap_destroy_sub_req(rr);
                 }
             }
@@ -3024,7 +3021,6 @@
     request_rec *r = f->r;
     include_ctx_t *ctx = f->ctx;
     request_rec *parent;
-    apr_status_t rv;
     include_dir_config *conf = 
                    (include_dir_config *)ap_get_module_config(r->per_dir_config,
                                                               &include_module);
@@ -3108,15 +3104,7 @@
     apr_table_unset(f->r->headers_out, "ETag");
     apr_table_unset(f->r->headers_out, "Last-Modified");
 
-    rv = send_parsed_content(&b, r, f);
-
-    if (parent) {
-        /* signify that the sub request should not be killed */
-        ap_set_module_config(r->request_config, &include_module,
-            NESTED_INCLUDE_MAGIC);
-    }
-
-    return rv;
+    return send_parsed_content(&b, r, f);
 }
 
 static void ap_register_include_handler(char *tag, include_handler_fn_t *func)

Reply via email to