Commit 1b47ef4e authored by Jim Jagielski's avatar Jim Jagielski
Browse files

Merge r1744458, r1744459 from trunk:

Avoid memory allocation before making sure that this handler can handle the URL

Avoid memory allocation before making sure that this handler can handle the URL
Submitted by: jailletc36
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1748210 13f79535-47bb-0310-9956-ffa450edef68
parent 9714718c
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -114,13 +114,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
  [ start all new proposals below, under PATCHES PROPOSED. ]

  *) mod_proxy_(fcgi|scgi): save a few bytes in the request pool when this
     handler is not able to process the URL.
     trunk patch: http://svn.apache.org/r1744458
                  http://svn.apache.org/r1744459
     2.4.x patch: trunk works
     +1: jailletc36, jim, trawick

  *) http: Add 451 status code
     trunk patch: http://svn.apache.org/r1730723
     2.4.x: trunk works
+3 −2
Original line number Diff line number Diff line
@@ -876,13 +876,13 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker,
    char server_portstr[32];
    conn_rec *origin = NULL;
    proxy_conn_rec *backend = NULL;
    apr_uri_t *uri;

    proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
                                                 &proxy_module);

    apr_pool_t *p = r->pool;

    apr_uri_t *uri = apr_palloc(r->pool, sizeof(*uri));

    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01076)
                  "url: %s proxyname: %s proxyport: %d",
@@ -909,6 +909,7 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker,
    backend->is_ssl = 0;

    /* Step One: Determine Who To Connect To */
    uri = apr_palloc(p, sizeof(*uri));
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
                                           uri, &url, proxyname, proxyport,
                                           server_portstr,
+3 −2
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ static int scgi_handler(request_rec *r, proxy_worker *worker,
    int status;
    proxy_conn_rec *backend = NULL;
    apr_pool_t *p = r->pool;
    apr_uri_t *uri = apr_palloc(r->pool, sizeof(*uri));
    apr_uri_t *uri;
    char dummy;

    if (strncasecmp(url, SCHEME "://", sizeof(SCHEME) + 2)) {
@@ -548,6 +548,7 @@ static int scgi_handler(request_rec *r, proxy_worker *worker,
    backend->is_ssl = 0;

    /* Step One: Determine Who To Connect To */
    uri = apr_palloc(p, sizeof(*uri));
    status = ap_proxy_determine_connection(p, r, conf, worker, backend,
                                           uri, &url, proxyname, proxyport,
                                           &dummy, 1);