]> granicus.if.org Git - apache/commitdiff
Get nph- CGI scripts working again by avoiding filters that can't
authorJeff Trawick <trawick@apache.org>
Wed, 20 Mar 2002 13:57:08 +0000 (13:57 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 20 Mar 2002 13:57:08 +0000 (13:57 +0000)
possibly deal with a script that generates the protocol header.

PR:       8902, 8907, 9983

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

CHANGES
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c

diff --git a/CHANGES b/CHANGES
index dc49f29f80b46b23781670f46f975140e109816b..28ae56f61127a5e0e26491b877f24bf521e4f4c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
 Changes with Apache 2.0.34-dev
 
+  *) Get nph- CGI scripts working again.  PRs 8902, 8907, 9983
+     [Jeff Trawick]
+
   *) Upgraded PCRE library to latest version 3.9 [Brian Pane]
 
   *) Add accessor function to set r->content_type. From now on,
index ed475d616d863eec80cf4d2a3ced870596efa6fd..a9eee2aaa66a223195081f2e05140333d5a8c315 100644 (file)
@@ -739,6 +739,19 @@ static int cgi_handler(request_rec *r)
     }
 
     if (script_in && nph) {
+        struct ap_filter_t *cur;
+        
+        /* get rid of all filters up through protocol...  since we
+         * haven't parsed off the headers, there is no way they can
+         * work
+         */
+
+        cur = r->proto_output_filters;
+        while (cur && cur->frec->ftype < AP_FTYPE_CONNECTION) {
+            cur = cur->next;
+        }
+        r->output_filters = r->proto_output_filters = cur;
+
         bb = apr_brigade_create(r->pool);
        b = apr_bucket_pipe_create(script_in);
        APR_BRIGADE_INSERT_TAIL(bb, b);
index 5056218befe72d68e238abc641497ff951c3b1cc..b3c0a3aca0921a2a8c7fa2a013f3d1f89f6c28c4 100644 (file)
@@ -1159,12 +1159,25 @@ static int cgid_handler(request_rec *r)
     } 
 
     if (nph) {
+        struct ap_filter_t *cur;
+        
         /* Passing our socket down the filter chain in a pipe bucket
          * gives up the responsibility of closing the socket, so
          * get rid of the cleanup.
          */
         apr_pool_cleanup_kill(r->pool, (void *)sd, close_unix_socket);
 
+        /* get rid of all filters up through protocol...  since we
+         * haven't parsed off the headers, there is no way they can
+         * work
+         */
+
+        cur = r->proto_output_filters;
+        while (cur && cur->frec->ftype < AP_FTYPE_CONNECTION) {
+            cur = cur->next;
+        }
+        r->output_filters = r->proto_output_filters = cur;
+
         bb = apr_brigade_create(r->pool);
         b = apr_bucket_pipe_create(tempsock);
         APR_BRIGADE_INSERT_TAIL(bb, b);