From: Jeff Trawick Date: Wed, 20 Mar 2002 13:57:08 +0000 (+0000) Subject: Get nph- CGI scripts working again by avoiding filters that can't X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2bbaafd2675f2fe4573b3a721a78c5633dd9380c;p=apache Get nph- CGI scripts working again by avoiding filters that can't 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 --- diff --git a/CHANGES b/CHANGES index dc49f29f80..28ae56f611 100644 --- 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, diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index ed475d616d..a9eee2aaa6 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -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); diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 5056218bef..b3c0a3aca0 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -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);