Lines 703-725
Link Here
|
703 |
&proxy_module); |
703 |
&proxy_module); |
704 |
|
704 |
|
705 |
/* |
705 |
/* |
706 |
* Note: Memory pool allocation. |
706 |
* Use a shorter-lived pool to reduce memory usage |
707 |
* A downstream keepalive connection is always connected to the existence |
707 |
* and avoid a memory leak |
708 |
* (or not) of an upstream keepalive connection. If this is not done then |
|
|
709 |
* load balancing against multiple backend servers breaks (one backend |
710 |
* server ends up taking 100% of the load), and the risk is run of |
711 |
* downstream keepalive connections being kept open unnecessarily. This |
712 |
* keeps webservers busy and ties up resources. |
713 |
* |
714 |
* As a result, we allocate all sockets out of the upstream connection |
715 |
* pool, and when we want to reuse a socket, we check first whether the |
716 |
* connection ID of the current upstream connection is the same as that |
717 |
* of the connection when the socket was opened. |
718 |
*/ |
708 |
*/ |
719 |
apr_pool_t *p = r->connection->pool; |
709 |
apr_pool_t *p = r->pool; |
720 |
apr_uri_t *uri = apr_palloc(r->connection->pool, sizeof(*uri)); |
710 |
apr_uri_t *uri = apr_palloc(p, sizeof(*uri)); |
721 |
|
711 |
|
722 |
|
|
|
723 |
if (strncasecmp(url, "ajp:", 4) != 0) { |
712 |
if (strncasecmp(url, "ajp:", 4) != 0) { |
724 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "declining URL %s", url); |
713 |
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "declining URL %s", url); |
725 |
return DECLINED; |
714 |
return DECLINED; |