]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
merge this fix from 2.1-dev:
authorJeff Trawick <trawick@apache.org>
Wed, 17 Sep 2003 10:53:32 +0000 (10:53 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 17 Sep 2003 10:53:32 +0000 (10:53 +0000)
     * 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

STATUS
modules/generators/mod_cgid.c

diff --git a/STATUS b/STATUS
index 0b6f52173b219efd4b66fea9d49252e5708235d3..70bde371969d0ef7c3609a63153dd7b45fcfb132 100644 (file)
--- 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.
index 44845ff51afa9e339de04e545c6e609c3a0258b8..3b009a218cb53c3bf56bb9fe92af1cab8ea631b1 100644 (file)
@@ -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;
 }