Author: richter
Date: Fri Dec  9 12:59:37 2005
New Revision: 355598

URL: http://svn.apache.org/viewcvs?rev=355598&view=rev
Log:
fix cookie expire

Modified:
    perl/embperl/trunk/Changes.pod
    perl/embperl/trunk/epcgiinit.c
    perl/embperl/trunk/epdat2.h
    perl/embperl/trunk/epinit.c
    perl/embperl/trunk/epmain.c
    perl/embperl/trunk/mod_embperl.c
    perl/embperl/trunk/podsrc/Config.spod
    perl/embperl/trunk/test/cmp/cookieexpire.htm
    perl/embperl/trunk/test/html/cookieexpire.htm
    perl/embperl/trunk/xsbuilder/maps/ep_structure.map

Modified: perl/embperl/trunk/Changes.pod
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/Changes.pod?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/Changes.pod (original)
+++ perl/embperl/trunk/Changes.pod Fri Dec  9 12:59:37 2005
@@ -7,6 +7,12 @@
       for debugging purpose.
     - [$ sub $] return value is handled now corretly
       in scalar and array context
+    - Added Table of Content pod file, which lists
+      all available Embperl documentation, to get
+      a better overview. Thanks to Axel Beckert.
+    - Fixed Cookie expire calculation, because
+      relative exipre times where only calculated
+      once at server startup. Spotted by Derrick Spell. 
 
 =head1 2.1.0  15. Nov 2005
 

Modified: perl/embperl/trunk/epcgiinit.c
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/epcgiinit.c?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/epcgiinit.c (original)
+++ perl/embperl/trunk/epcgiinit.c Fri Dec  9 12:59:37 2005
@@ -74,7 +74,7 @@
         if (!embperl_CalcExpires (s, buf, 0)) \
             LogErrorParam (NULL, rcTimeFormatErr, "EMBPERL_"#CFGNAME, s) ; \
         else \
-            pConfig -> NAME   = ep_pstrdup (pPool, buf) ; \
+            pConfig -> NAME   = ep_pstrdup (pPool, s) ; \
         } \
     } \
     tainted = 0 ; 

Modified: perl/embperl/trunk/epdat2.h
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/epdat2.h?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/epdat2.h (original)
+++ perl/embperl/trunk/epdat2.h Fri Dec  9 12:59:37 2005
@@ -144,7 +144,7 @@
     char *  sCookieName ;
     char *  sCookieDomain ;
     char *  sCookiePath ;
-    char *  sCookieExpires ;
+    char *  sCookieExpires ;   /**< Argument given in config for cookie 
expires **/
     bool    bCookieSecure ;
     char *  sLog ;
     unsigned    bDebug ;
@@ -393,6 +393,7 @@
     char *  sSessionID ;        /**< stores session name and id for status 
session data */
     char *  sSessionUserID ;    /**< received id of user session data */
     char *  sSessionStateID ;   /**< received id of state session data */
+    char *  sCookieExpires ;   /**< Time when cookie expires **/       
 
     int            bExit ;             /**< We should exit the request */
     long    nLogFileStartPos ;  /**< file position of logfile, when logfile 
started */

Modified: perl/embperl/trunk/epinit.c
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/epinit.c?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/epinit.c (original)
+++ perl/embperl/trunk/epinit.c Fri Dec  9 12:59:37 2005
@@ -1481,6 +1481,16 @@
             r -> sSessionUserID = ep_pstrdup (r -> pPool, pVal) ;
         }
 
+    if (r -> pApp -> Config.sCookieExpires)
+        {
+        char buf[256] ; 
+
+        if (!embperl_CalcExpires(r -> pApp -> Config.sCookieExpires, buf, 0)) 
+            LogErrorParam (r -> pApp, rcTimeFormatErr, 
"EMBPERL_COOKIE_EXPIRES", r -> pApp -> Config.sCookieExpires) ; 
+        else
+            r -> sCookieExpires = ep_pstrdup (r -> pPool, buf) ;    
+        }    
+
     if (r -> pApp -> pUserHash)
         r -> nSessionMgnt = 1 ;
 

Modified: perl/embperl/trunk/epmain.c
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/epmain.c?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/epmain.c (original)
+++ perl/embperl/trunk/epmain.c Fri Dec  9 12:59:37 2005
@@ -538,8 +538,8 @@
                     pCookie = ep_pstrcat (r -> pPool, pCookie, "; domain=", 
pCfg -> sCookieDomain, NULL) ;
                 if (pCfg -> sCookiePath)
                     pCookie = ep_pstrcat (r -> pPool, pCookie, "; path=", pCfg 
-> sCookiePath, NULL) ;
-                if (pCfg -> sCookieExpires)
-                    pCookie = ep_pstrcat (r -> pPool, pCookie, "; expires=", 
pCfg -> sCookieExpires, NULL) ;
+                if (r -> sCookieExpires)
+                    pCookie = ep_pstrcat (r -> pPool, pCookie, "; expires=", r 
-> sCookieExpires, NULL) ;
                 if (pCfg -> bCookieSecure)
                     pCookie = ep_pstrcat (r -> pPool, pCookie, "; secure", 
NULL) ;
 

Modified: perl/embperl/trunk/mod_embperl.c
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/mod_embperl.c?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/mod_embperl.c (original)
+++ perl/embperl/trunk/mod_embperl.c Fri Dec  9 12:59:37 2005
@@ -842,7 +842,7 @@
     if (!embperl_CalcExpires(arg, buf, 0)) \
         LogErrorParam (NULL, rcTimeFormatErr, "EMBPERL_"#CFGNAME, arg) ; \
     else \
-        ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = ap_pstrdup(p, buf) ; \
+        ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = ap_pstrdup(p, arg) ; \
     ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
     if (bApDebug) \
         ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, 
APLOG_STATUSCODE NULL, "EmbperlDebug: Set "#CFGNAME" (type="#TYPE";STR) = 
%s\n", arg) ; \

Modified: perl/embperl/trunk/podsrc/Config.spod
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/podsrc/Config.spod?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/podsrc/Config.spod (original)
+++ perl/embperl/trunk/podsrc/Config.spod Fri Dec  9 12:59:37 2005
@@ -1656,6 +1656,10 @@
 Id of the current user session as received by the browser, this
 means this method returns C<undef> for a new session.
 
+=head2 *METHOD $request / / cookie_expires / 2.1.1 / no 
+
+Can be used to retrieve the actual expiration date that Embperl uses for the 
cookie with the session id.
+
 =head2 *METHOD $request / / had_exit / 2.0b6 / no
 
 True if exit was called in one of the components processed so far.

Modified: perl/embperl/trunk/test/cmp/cookieexpire.htm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/test/cmp/cookieexpire.htm?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/test/cmp/cookieexpire.htm (original)
+++ perl/embperl/trunk/test/cmp/cookieexpire.htm Fri Dec  9 12:59:37 2005
@@ -1,4 +1,5 @@
 
-app_name:       Embperl
-^cookie_expires: \w\w\w, \d+-\w\w\w-\d\d\d\d \d\d:\d\d:\d\d GMT
-output_mode:   0
+app_name:           Embperl
+cookie_expires cfg: +120s
+^cookie_expires req: \w\w\w, \d+-\w\w\w-\d\d\d\d \d\d:\d\d:\d\d GMT
+output_mode:       0

Modified: perl/embperl/trunk/test/html/cookieexpire.htm
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/test/html/cookieexpire.htm?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/test/html/cookieexpire.htm (original)
+++ perl/embperl/trunk/test/html/cookieexpire.htm Fri Dec  9 12:59:37 2005
@@ -1,7 +1,8 @@
 
 [- $r = shift -]
 
-app_name:       [+ $r -> app -> config -> app_name +]
-cookie_expires: [+ $r -> app -> config -> cookie_expires +]
-output_mode:   [+ $r -> config -> output_mode +]
+app_name:           [+ $r -> app -> config -> app_name +]
+cookie_expires cfg: [+ $r -> app -> config -> cookie_expires +]
+cookie_expires req: [+ $r -> cookie_expires +]
+output_mode:       [+ $r -> config -> output_mode +]
 

Modified: perl/embperl/trunk/xsbuilder/maps/ep_structure.map
URL: 
http://svn.apache.org/viewcvs/perl/embperl/trunk/xsbuilder/maps/ep_structure.map?rev=355598&r1=355597&r2=355598&view=diff
==============================================================================
--- perl/embperl/trunk/xsbuilder/maps/ep_structure.map (original)
+++ perl/embperl/trunk/xsbuilder/maps/ep_structure.map Fri Dec  9 12:59:37 2005
@@ -37,6 +37,7 @@
    sSessionID | session_id
    sSessionStateID | session_state_id
    sSessionUserID  | session_user_id
+   sCookieExpires | cookie_expires
    bExit | had_exit
    nLogFileStartPos | log_file_start_pos
    bError | error



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to