httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r230714 - /httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c
Date Sun, 07 Aug 2005 23:45:57 GMT
Author: wrowe
Date: Sun Aug  7 16:45:54 2005
New Revision: 230714

URL: http://svn.apache.org/viewcvs?rev=230714&view=rev
Log:

  Pre-commit a simple bit from r219224, pass an initialized input_brigade
  off to the spool/stream functions.  Effectively a no-op so far, but in
  a couple of patches, the reason becomes obvious.

Modified:
    httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c

Modified: httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c?rev=230714&r1=230713&r2=230714&view=diff
==============================================================================
--- httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c (original)
+++ httpd/httpd/branches/proxy-reqbody-2.0.x/modules/proxy/proxy_http.c Sun Aug  7 16:45:54
2005
@@ -455,18 +455,17 @@
                                            request_rec *r,
                                            proxy_http_conn_t *p_conn,
                                            conn_rec *origin,
-                                           apr_bucket_brigade *header_brigade)
+                                           apr_bucket_brigade *header_brigade,
+                                           apr_bucket_brigade *input_brigade)
 {
     int seen_eos = 0;
     apr_size_t hdr_len;
     apr_off_t bytes;
     apr_status_t status;
     apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
-    apr_bucket_brigade *b, *input_brigade;
+    apr_bucket_brigade *b;
     apr_bucket *e;
 
-    input_brigade = apr_brigade_create(p, bucket_alloc);
-
     do {
         char chunk_hdr[20];  /* must be here due to transient bucket. */
 
@@ -562,16 +561,15 @@
                                       proxy_http_conn_t *p_conn,
                                       conn_rec *origin,
                                       apr_bucket_brigade *header_brigade,
+                                      apr_bucket_brigade *input_brigade,
                                       const char *old_cl_val)
 {
     int seen_eos = 0;
     apr_status_t status;
     apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
-    apr_bucket_brigade *b, *input_brigade;
+    apr_bucket_brigade *b;
     apr_bucket *e;
 
-    input_brigade = apr_brigade_create(p, bucket_alloc);
-
     do {
         status = ap_get_brigade(r->input_filters, input_brigade,
                                 AP_MODE_READBYTES, APR_BLOCK_READ,
@@ -642,18 +640,18 @@
                                      request_rec *r,
                                      proxy_http_conn_t *p_conn,
                                      conn_rec *origin,
-                                     apr_bucket_brigade *header_brigade)
+                                     apr_bucket_brigade *header_brigade,
+                                     apr_bucket_brigade *input_brigade)
 {
     int seen_eos = 0;
     apr_status_t status;
     apr_bucket_alloc_t *bucket_alloc = r->connection->bucket_alloc;
-    apr_bucket_brigade *body_brigade, *input_brigade;
+    apr_bucket_brigade *body_brigade;
     apr_bucket *e;
     apr_off_t bytes, bytes_spooled = 0, fsize = 0;
     apr_file_t *tmpfile = NULL;
 
     body_brigade = apr_brigade_create(p, bucket_alloc);
-    input_brigade = apr_brigade_create(p, bucket_alloc);
 
     do {
         status = ap_get_brigade(r->input_filters, input_brigade,
@@ -778,6 +776,7 @@
                                    char *url, apr_bucket_brigade *bb,
                                    char *server_portstr) {
     conn_rec *c = r->connection;
+    apr_bucket_brigade *input_brigade;
     char *buf;
     apr_bucket *e;
     const apr_array_header_t *headers_in_array;
@@ -985,6 +984,9 @@
         APR_BRIGADE_INSERT_TAIL(bb, e);
     }
 
+    /* We have headers, let's figure out our request body... */
+    input_brigade = apr_brigade_create(p, bucket_alloc);
+
     /* sub-requests never use keepalives, and mustn't pass request bodies.
      * Because the new logic looks at input_brigade, we must self-terminate
      * input_brigade and jump past all of the request body logic...
@@ -1061,13 +1063,16 @@
 
     switch(rb_method) {
     case RB_STREAM_CHUNKED:
-        status = stream_reqbody_chunked(p, r, p_conn, origin, bb);
+        status = stream_reqbody_chunked(p, r, p_conn, origin, bb, 
+                                        input_brigade);
         break;
     case RB_STREAM_CL:
-        status = stream_reqbody_cl(p, r, p_conn, origin, bb, old_cl_val);
+        status = stream_reqbody_cl(p, r, p_conn, origin, bb, 
+                                   input_brigade, old_cl_val);
         break;
     case RB_SPOOL_CL:
-        status = spool_reqbody_cl(p, r, p_conn, origin, bb);
+        status = spool_reqbody_cl(p, r, p_conn, origin, bb,
+                                  input_brigade);
         break;
     default:
         ap_assert(1 != 1);



Mime
View raw message