From: Jeff Trawick Date: Wed, 17 Sep 2003 10:53:32 +0000 (+0000) Subject: merge this fix from 2.1-dev: X-Git-Tag: 2.0.48~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb2064763b4a4b90394f590e526fedf5a9cb352;p=thirdparty%2Fapache%2Fhttpd.git merge this fix from 2.1-dev: * Fix include_cmd in mod_cgid, not to treat the cmd output (partially) as CGI output. Submitted by: Andr�� Malo Reviewed by: trawick, brianp git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101266 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 0b6f52173b2..70bde371969 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/09/17 10:47:38 $] +Last modified at [$Date: 2003/09/17 10:53:32 $] Release: @@ -311,11 +311,6 @@ PATCHES TO PORT FROM 2.1 with some valid "fake" values. Though I don't think that it's really necessary -- how does this sound? - * Fix include_cmd in mod_cgid, not to treat the cmd output (partially) - as CGI output. - modules/generators/mod_cgid.c: r1.153 - +1: nd, trawick, brianp - * Fix inconsistency in generated expression parse tree. (2.0 + 1.3) There's also a practical advantage; it saves some CPU cycles, since the tree walk is shorter. diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 44845ff51af..3b009a218cb 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -1605,7 +1605,6 @@ static int include_cmd(include_ctx_t *ctx, apr_bucket_brigade **bb, char *comman request_rec *r, ap_filter_t *f) { char **env; - const char *location; int sd; apr_status_t rc = APR_SUCCESS; int retval; @@ -1648,53 +1647,16 @@ static int include_cmd(include_ctx_t *ctx, apr_bucket_brigade **bb, char *comman */ apr_os_pipe_put(&tempsock, &sd, r->pool); - if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) - return retval; - - location = apr_table_get(r->headers_out, "Location"); - - if (location && location[0] == '/' && r->status == 200) { - char argsbuffer[HUGE_STRING_LEN]; - - /* Soak up all the script output */ - while (apr_file_gets(argsbuffer, HUGE_STRING_LEN, - tempsock) == APR_SUCCESS) { - continue; - } - /* This redirect needs to be a GET no matter what the original - * method was. - */ - r->method = apr_pstrdup(r->pool, "GET"); - r->method_number = M_GET; - - /* We already read the message body (if any), so don't allow - * the redirected request to think it has one. We can ignore - * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR. - */ - apr_table_unset(r->headers_in, "Content-Length"); - - ap_internal_redirect_handler(location, r); - return OK; - } - else if (location && r->status == 200) { - /* XX Note that if a script wants to produce its own Redirect - * body, it now has to explicitly *say* "Status: 302" - */ - return HTTP_MOVED_TEMPORARILY; - } - - if (!r->header_only) { - /* 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); + /* 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); - bcgi = apr_brigade_create(r->pool, r->connection->bucket_alloc); - b = apr_bucket_pipe_create(tempsock, r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bcgi, b); - ap_pass_brigade(f->next, bcgi); - } + bcgi = apr_brigade_create(r->pool, r->connection->bucket_alloc); + b = apr_bucket_pipe_create(tempsock, r->connection->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(bcgi, b); + ap_pass_brigade(f->next, bcgi); return 0; }