From a4c79850d23ecb3fcbfe8d1daeb3d584c2207c35 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 24 Jan 2014 13:25:27 +0000 Subject: [PATCH] Merge r1560977 from trunk: mod_session: When we have a session we were unable to decode, behave as if there was no session at all. Submitted by: minfrin Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1560991 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ STATUS | 6 ------ modules/session/mod_session.c | 30 ++++++++++++++++++------------ 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CHANGES b/CHANGES index f86369648c..cc899c5e2a 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.4.8 + *) mod_session: When we have a session we were unable to decode, + behave as if there was no session at all. [Thomas Eckert + ] + *) mod_session: Fix problems interpreting the SessionInclude and SessionExclude configuration. PR 56038. [Erik Pearson ] diff --git a/STATUS b/STATUS index 693174a650..bbc6e1168a 100644 --- a/STATUS +++ b/STATUS @@ -98,12 +98,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_session: When we have a session we were unable to decode, behave as if - there was no session at all. - trunk patch: http://svn.apache.org/r1560977 - 2.4.x patch: trunk works (modulo changes) - +1: minfrin, trawick, jim - PATCHES PROPOSED TO BACKPORT FROM TRUNK: diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c index 48475c0725..0b472a240e 100644 --- a/modules/session/mod_session.c +++ b/modules/session/mod_session.c @@ -126,22 +126,28 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z) /* found a session that hasn't expired? */ now = apr_time_now(); - if (!zz || (zz->expiry && zz->expiry < now)) { + if (zz) { + if (zz->expiry && zz->expiry < now) { + zz = NULL; + } + else { + /* having a session we cannot decode is just as good as having + none at all */ + rv = ap_run_session_decode(r, zz); + if (OK != rv) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817) + "error while decoding the session, " + "session not loaded: %s", r->uri); + zz = NULL; + } + } + } - /* no luck, create a blank session */ + /* no luck, create a blank session */ + if (!zz) { zz = (session_rec *) apr_pcalloc(r->pool, sizeof(session_rec)); zz->pool = r->pool; zz->entries = apr_table_make(zz->pool, 10); - - } - else { - rv = ap_run_session_decode(r, zz); - if (OK != rv) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817) - "error while decoding the session, " - "session not loaded: %s", r->uri); - return rv; - } } /* make sure the expiry and maxage are set, if present */ -- 2.40.0