Commit bfd5d2e3 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Fix some very minor nits in ap_proxy_http_request() which make it
  quite simple to diff to the current trunk/ code, ensuring the most
  accurate review possible.

  Consists only of whitespace and line spacing changes, and a change
  from 'bb' to 'header_brigade' for this local argument variable's name,
  so there are no functional changes here.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/proxy-reqbody-2.0.x@230741 13f79535-47bb-0310-9956-ffa450edef68
parent e7755419
Loading
Loading
Loading
Loading
+15 −13
Original line number Original line Diff line number Diff line
@@ -789,7 +789,8 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
                                   proxy_http_conn_t *p_conn, conn_rec *origin, 
                                   proxy_http_conn_t *p_conn, conn_rec *origin, 
                                   proxy_server_conf *conf,
                                   proxy_server_conf *conf,
                                   apr_uri_t *uri,
                                   apr_uri_t *uri,
                                   char *url, apr_bucket_brigade *bb,
                                   char *url, 
                                   apr_bucket_brigade *header_brigade,
                                   char *server_portstr) 
                                   char *server_portstr) 
{
{
    conn_rec *c = r->connection;
    conn_rec *c = r->connection;
@@ -845,11 +846,11 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
    }
    }
    ap_xlate_proto_to_ascii(buf, strlen(buf));
    ap_xlate_proto_to_ascii(buf, strlen(buf));
    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
    APR_BRIGADE_INSERT_TAIL(bb, e);
    APR_BRIGADE_INSERT_TAIL(header_brigade, e);
    if (conf->preserve_host == 0) {
    if (conf->preserve_host == 0) {
        if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) {
        if (uri->port_str && uri->port != DEFAULT_HTTP_PORT) {
            buf = apr_pstrcat(p, "Host: ", uri->hostname, ":", uri->port_str, CRLF,
            buf = apr_pstrcat(p, "Host: ", uri->hostname, ":", uri->port_str,
                            NULL);
                              CRLF, NULL);
        } else {
        } else {
            buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL);
            buf = apr_pstrcat(p, "Host: ", uri->hostname, CRLF, NULL);
        }
        }
@@ -872,7 +873,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
    }
    }
    ap_xlate_proto_to_ascii(buf, strlen(buf));
    ap_xlate_proto_to_ascii(buf, strlen(buf));
    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);        
    e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);        
    APR_BRIGADE_INSERT_TAIL(bb, e);
    APR_BRIGADE_INSERT_TAIL(header_brigade, e);


    /* handle Via */
    /* handle Via */
    if (conf->viaopt == via_block) {
    if (conf->viaopt == via_block) {
@@ -1000,7 +1001,7 @@ apr_status_t ap_proxy_http_request(apr_pool_t *p, request_rec *r,
                          NULL);
                          NULL);
        ap_xlate_proto_to_ascii(buf, strlen(buf));
        ap_xlate_proto_to_ascii(buf, strlen(buf));
        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
        APR_BRIGADE_INSERT_TAIL(bb, e);
        APR_BRIGADE_INSERT_TAIL(header_brigade, e);
    }
    }


    /* We have headers, let's figure out our request body... */
    /* We have headers, let's figure out our request body... */
@@ -1174,27 +1175,28 @@ skip_body:
        buf = apr_pstrdup(p, "Connection: close" CRLF);
        buf = apr_pstrdup(p, "Connection: close" CRLF);
        ap_xlate_proto_to_ascii(buf, strlen(buf));
        ap_xlate_proto_to_ascii(buf, strlen(buf));
        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
        e = apr_bucket_pool_create(buf, strlen(buf), p, c->bucket_alloc);
        APR_BRIGADE_INSERT_TAIL(bb, e);
        APR_BRIGADE_INSERT_TAIL(header_brigade, e);
    }
    }


    /* send the request body, if any. */
    /* send the request body, if any. */
    switch(rb_method) {
    switch(rb_method) {
    case RB_STREAM_CHUNKED:
    case RB_STREAM_CHUNKED:
        status = stream_reqbody_chunked(p, r, p_conn, origin, bb, 
        status = stream_reqbody_chunked(p, r, p_conn, origin, header_brigade, 
                                        input_brigade);
                                        input_brigade);
        break;
        break;
    case RB_STREAM_CL:
    case RB_STREAM_CL:
        status = stream_reqbody_cl(p, r, p_conn, origin, bb, 
        status = stream_reqbody_cl(p, r, p_conn, origin, header_brigade, 
                                   input_brigade, old_cl_val);
                                   input_brigade, old_cl_val);
        break;
        break;
    case RB_SPOOL_CL:
    case RB_SPOOL_CL:
        status = spool_reqbody_cl(p, r, p_conn, origin, bb,
        status = spool_reqbody_cl(p, r, p_conn, origin, header_brigade,
                                  input_brigade, (old_cl_val != NULL)
                                  input_brigade, (old_cl_val != NULL)
                                              || (old_te_val != NULL)
                                              || (old_te_val != NULL)
                                              || (bytes_read > 0));
                                              || (bytes_read > 0));
        break;
        break;
    default:
    default:
        ap_assert(1 != 1);
        ap_assert(1 != 1);
        break;
    }
    }


    if (status != APR_SUCCESS) {
    if (status != APR_SUCCESS) {