Return-Path: Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 84432 invoked by uid 500); 15 Mar 2002 21:33:16 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 84413 invoked from network); 15 Mar 2002 21:33:16 -0000 Date: Fri, 15 Mar 2002 16:30:36 -0500 Message-Id: <200203152130.g2FLUap08251@smtp-server.nc.rr.com> X-Authentication-Warning: rdu88-250-166.nc.rr.com: trawick set sender to trawick@attglobal.net using -f From: Jeff Trawick To: dev@httpd.apache.org Subject: [PATCH] PRs 8902, 8907, 9983: get nph scripts working Reply-to: trawick@attglobal.net X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Axing unnecessary/harmful filters gets nph scripts working again. If someone ever wants nph function beyond what 1.3 provides then of course it gets more complicated and NPH probably turns into "we can't avoid parsing it but we'll still trust you". (examples: filtering content, byterange requests, letting script on EBCDIC box output headers in EBCDIC). I doubt that it is worth the effort. My first patch shown at the bottom, but that left the byterange filter in the chain, and that is just going to make a mess of things. Index: modules/generators/mod_cgid.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v retrieving revision 1.116 diff -u -r1.116 mod_cgid.c --- modules/generators/mod_cgid.c 14 Mar 2002 22:19:13 -0000 1.116 +++ modules/generators/mod_cgid.c 15 Mar 2002 21:29:17 -0000 @@ -1148,11 +1148,24 @@ } 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); (imagine the same change to mod_cgi.c) Comments? Thoughts on a better way to do it without boiling the ocean? -------first patch----------- Index: modules/generators/mod_cgi.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgi.c,v retrieving revision 1.120 diff -u -r1.120 mod_cgi.c --- modules/generators/mod_cgi.c 14 Mar 2002 22:19:13 -0000 1.120 +++ modules/generators/mod_cgi.c 15 Mar 2002 20:58:55 -0000 @@ -733,6 +733,7 @@ } if (script_in && nph) { + r->assbackwards = 1; /* tell core not to generate headers */ bb = apr_brigade_create(r->pool); b = apr_bucket_pipe_create(script_in); APR_BRIGADE_INSERT_TAIL(bb, b); Index: modules/generators/mod_cgid.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v retrieving revision 1.116 diff -u -r1.116 mod_cgid.c --- modules/generators/mod_cgid.c 14 Mar 2002 22:19:13 -0000 1.116 +++ modules/generators/mod_cgid.c 15 Mar 2002 20:58:55 -0000 @@ -1154,6 +1154,7 @@ */ apr_pool_cleanup_kill(r->pool, (void *)sd, close_unix_socket); + r->assbackwards = 1; /* tell core not to generate headers */ bb = apr_brigade_create(r->pool); b = apr_bucket_pipe_create(tempsock); APR_BRIGADE_INSERT_TAIL(bb, b); -- Jeff Trawick | trawick@attglobal.net Born in Roswell... married an alien...