summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett Rooney <rooneg@apache.org>2006-01-29 01:19:47 +0000
committerGarrett Rooney <rooneg@apache.org>2006-01-29 01:19:47 +0000
commit10240118aec8c994f93078c3b394d9185581dfee (patch)
treee95604817f35bccfbc325e717c757f48f010d8c4
parentc198ffb7a0f09d9b1334526d2ee7712d5046457e (diff)
downloadhttpd-10240118aec8c994f93078c3b394d9185581dfee.tar.gz
Now that the dispatch function handles the entire request there's no need
to create a long lived pool, we can use one that's local to the function. * modules/proxy/mod_proxy_fcgi.c (proxy_fcgi_baton_t): Removed. (dispatch): Use a local setaside pool instead of one from the baton. (proxy_fcgi_handler): Don't bother creating a baton. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/fcgi-proxy-dev@373269 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/proxy/mod_proxy_fcgi.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c
index 172f6f9fdf..f78e2d96f4 100644
--- a/modules/proxy/mod_proxy_fcgi.c
+++ b/modules/proxy/mod_proxy_fcgi.c
@@ -420,10 +420,6 @@ static int handle_headers(request_rec *r,
return 0;
}
-typedef struct {
- apr_pool_t *scratch_pool;
-} proxy_fcgi_baton_t;
-
static void dump_header_to_log(request_rec *r, unsigned char fheader[],
apr_size_t length)
{
@@ -489,7 +485,6 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r,
{
apr_bucket_brigade *ib, *ob;
int seen_end_of_headers = 0, done = 0;
- proxy_fcgi_baton_t *pfb = conn->data;
apr_status_t rv = APR_SUCCESS;
conn_rec *c = r->connection;
struct iovec vec[2];
@@ -497,6 +492,9 @@ static apr_status_t dispatch(proxy_conn_rec *conn, request_rec *r,
unsigned char farray[FCGI_HEADER_LEN];
apr_pollfd_t pfd;
int header_state = HDR_STATE_READING_HEADERS;
+ apr_pool_t *setaside_pool;
+
+ apr_pool_create(&setaside_pool, r->pool);
pfd.desc_type = APR_POLL_SOCKET;
pfd.desc.s = conn->sock;
@@ -672,7 +670,7 @@ recv_again:
apr_brigade_cleanup(ob);
- apr_pool_clear(pfb->scratch_pool);
+ apr_pool_clear(setaside_pool);
}
else if (st == -1) {
rv = APR_EINVAL;
@@ -682,7 +680,7 @@ recv_again:
/* We're still looking for the end of the
* headers, so this part of the data will need
* to persist. */
- apr_bucket_setaside(b, pfb->scratch_pool);
+ apr_bucket_setaside(b, setaside_pool);
}
}
@@ -848,14 +846,6 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker,
}
return status;
}
-
- {
- proxy_fcgi_baton_t *pfb = apr_pcalloc(r->pool, sizeof(*pfb));
-
- apr_pool_create(&pfb->scratch_pool, r->pool);
-
- backend->data = pfb;
- }
}
backend->is_ssl = 0;