]> granicus.if.org Git - apache/commitdiff
Fixed the EOS handling for partial SSI directives at the end of
authorBrian Pane <brianp@apache.org>
Wed, 19 Jun 2002 07:21:45 +0000 (07:21 +0000)
committerBrian Pane <brianp@apache.org>
Wed, 19 Jun 2002 07:21:45 +0000 (07:21 +0000)
brigades.  (This was causing us to produce no output, not even
an HTTP response header, for a document containing an unterminated
"<!--#" directive

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

CHANGES
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index e7f1e0d3564b02a6afa0937842c612151bbb32dc..065d6d3781b505eb4cfcd5519478a9d840269271 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
 
 Changes with Apache 2.0.40
 
+  *) Fixed a mod_include error case in which no HTTP response was sent
+     to the client if an shtml document contained an unterminated SSI
+     directive [Brian Pane]
+
   *) Improve ap_get_client_block implementation by using APR-util brigade
      helper functions and relying on current filter assumptions.
      [Justin Erenkrantz]
index 3c208efcb362181a720134d34311ee3846bce09a..4b50c883b9d9115b9e1bcb069922db44378b4886 100644 (file)
@@ -3239,6 +3239,20 @@ static apr_status_t send_parsed_content(apr_bucket_brigade **bb,
                            /* Set aside tag, pass pre-tag... */
             tag_and_after = apr_brigade_split(*bb, ctx->head_start_bucket);
             ap_save_brigade(f, &ctx->ssi_tag_brigade, &tag_and_after, r->pool);
+            if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(ctx->ssi_tag_brigade))) {
+                apr_bucket *new_eos;
+                /* Make sure there's no EOS at the end of the set-aside
+                 * brigade, because we may later prepend it to some
+                 * other brigade
+                 */
+                APR_BUCKET_REMOVE(APR_BRIGADE_LAST(ctx->ssi_tag_brigade));
+
+                /* And put an EOS on the brigade that we're about to pass
+                 * to the next filter.
+                 */
+                new_eos = apr_bucket_eos_create((*bb)->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(*bb, new_eos);
+            }
             rv = ap_pass_brigade(f->next, *bb);
             if (rv != APR_SUCCESS) {
                 return rv;