]> granicus.if.org Git - apache/commitdiff
Merge r1560977 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 24 Jan 2014 13:25:27 +0000 (13:25 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 24 Jan 2014 13:25:27 +0000 (13:25 +0000)
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
STATUS
modules/session/mod_session.c

diff --git a/CHANGES b/CHANGES
index f86369648cb2cc2bdd5cc76a4aaf27d8e4e89ba6..cc899c5e2a0c607c69ab21af21e8ddba3a2603e2 100644 (file)
--- 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
+     <thomas.r.w.eckert gmail com>]
+
   *) mod_session: Fix problems interpreting the SessionInclude and
      SessionExclude configuration. PR 56038. [Erik Pearson
      <erik adaptations.com>]
diff --git a/STATUS b/STATUS
index 693174a65037958c225fe7dc3c111e565af71b36..bbc6e1168a4b7a6cfad95487d779ed40d970b9bd 100644 (file)
--- 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:
index 48475c0725c0a476baa2b477c14ff7294dff6918..0b472a240e01c93985e128549ae32e3c6a3211d7 100644 (file)
@@ -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 */