summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2015-06-23 12:54:15 +0200
committerYann Ylavic <ylavic@apache.org>2015-06-23 12:54:15 +0200
commit4aa8d59e9830baf38db11e3d18bf63ab6e415cd0 (patch)
treee8c0b35caef2bd20556b7152ae4bdfb36f9fd5f2 /modules
parentmod_alias: follow up to r1686853. (diff)
downloadapache2-4aa8d59e9830baf38db11e3d18bf63ab6e415cd0.tar.xz
apache2-4aa8d59e9830baf38db11e3d18bf63ab6e415cd0.zip
mod_session_dbd: follow up to r1686122.
DBD entries should also have request lifetime. Proposed by: Jacob Champion <jacob.champion ni.com> Reviewed by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1687021 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r--modules/session/mod_session_dbd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/session/mod_session_dbd.c b/modules/session/mod_session_dbd.c
index af2dc2d09e..0f473ffb02 100644
--- a/modules/session/mod_session_dbd.c
+++ b/modules/session/mod_session_dbd.c
@@ -94,8 +94,11 @@ static apr_status_t dbd_init(request_rec *r, const char *query, ap_dbd_t **dbdp,
/**
* Load the session by the key specified.
+ *
+ * The session value is allocated using the passed apr_pool_t.
*/
-static apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
+static apr_status_t dbd_load(request_rec * r, apr_pool_t *pool,
+ const char *key, const char **val)
{
apr_status_t rv;
@@ -138,7 +141,7 @@ static apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
return APR_EGENERAL;
}
if (*val == NULL) {
- *val = apr_pstrdup(r->pool,
+ *val = apr_pstrdup(pool,
apr_dbd_get_entry(dbd->driver, row, 0));
}
/* we can't break out here or row won't get cleaned up */
@@ -204,7 +207,7 @@ static apr_status_t session_dbd_load(request_rec * r, session_rec ** z)
/* load an RFC2109 or RFC2965 compliant cookie */
ap_cookie_read(r, name, &key, conf->remove);
if (key) {
- ret = dbd_load(r, key, &val);
+ ret = dbd_load(r, m->pool, key, &val);
if (ret != APR_SUCCESS) {
return ret;
}
@@ -215,7 +218,7 @@ static apr_status_t session_dbd_load(request_rec * r, session_rec ** z)
/* load named session */
else if (conf->peruser) {
if (r->user) {
- ret = dbd_load(r, r->user, &val);
+ ret = dbd_load(r, m->pool, r->user, &val);
if (ret != APR_SUCCESS) {
return ret;
}