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
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
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",
- url, proxyname, proxyport);
+ url, proxyname, proxyport);
if (strncasecmp(url, "fcgi:", 5) != 0) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01077) "declining URL %s", url);
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,
*status = HTTP_INTERNAL_SERVER_ERROR;
return *status;
}
- } while(0);
+ } while (0);
return OK;
/* break; */
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)) {
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);