richter     2003/02/15 12:46:33

  Modified:    .        Changes.pod MANIFEST embperl.h embpexec.pl.templ
                        epcgiinit.c epinit.c epmain.c eputil.c
                        mod_embperl.c test.pl
  Added:       test/cmp cookieexpire.htm
               test/html cookieexpire.htm
  Log:
  cookie expire
  
  Revision  Changes    Path
  1.200     +3 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.199
  retrieving revision 1.200
  diff -u -r1.199 -r1.200
  --- Changes.pod       14 Feb 2003 22:02:57 -0000      1.199
  +++ Changes.pod       15 Feb 2003 20:46:31 -0000      1.200
  @@ -60,6 +60,9 @@
      - Fixed compiling problem on FreeBSD.
      - Added function XML::Embperl::DOM::iSetText to change name of Tag.
        Requested by Yatin Chawathe.
  +   - EMBPERL_COOKIE_EXPIRES now again accepts relatives times like +2h.
  +   - embpexec.pl now correctly takes config values from environment
  +     for application object.
   
   =head1 2.0b8  (BETA)  25. Juni 2002
   
  
  
  
  1.78      +2 -0      embperl/MANIFEST
  
  Index: MANIFEST
  ===================================================================
  RCS file: /home/cvs/embperl/MANIFEST,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- MANIFEST  23 Dec 2002 10:08:54 -0000      1.77
  +++ MANIFEST  15 Feb 2003 20:46:31 -0000      1.78
  @@ -198,6 +198,7 @@
   test/cmp/changeattr.htm
   test/cmp/chdir.htm
   test/cmp/clearsess.htm
  +test/cmp/cookieexpire.htm
   test/cmp/crypto.htm
   test/cmp/delrdsess.htm
   test/cmp/delsess.htm
  @@ -417,6 +418,7 @@
   test/html/changeattr.htm
   test/html/chdir.htm
   test/html/clearsess.htm
  +test/html/cookieexpire.htm
   test/html/delrdsess.htm
   test/html/delsess.htm
   test/html/delwrsess.htm
  
  
  
  1.32      +2 -1      embperl/embperl.h
  
  Index: embperl.h
  ===================================================================
  RCS file: /home/cvs/embperl/embperl.h,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- embperl.h 26 Nov 2002 10:03:40 -0000      1.31
  +++ embperl.h 15 Feb 2003 20:46:31 -0000      1.32
  @@ -93,6 +93,7 @@
       rcApacheErr,
       rcTooDeepNested,
       rcUnknownOption,
  +    rcTimeFormatErr,
       rcForbidden = 403,
       rcNotFound  = 404,
       rcDecline   = -1
  
  
  
  1.5       +2 -1      embperl/embpexec.pl.templ
  
  Index: embpexec.pl.templ
  ===================================================================
  RCS file: /home/cvs/embperl/embpexec.pl.templ,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- embpexec.pl.templ 22 Oct 2002 05:29:04 -0000      1.4
  +++ embpexec.pl.templ 15 Feb 2003 20:46:31 -0000      1.5
  @@ -18,6 +18,7 @@
   BEGIN
       {
       DB::parse_options("NonStop=1") if (defined (&DB::parse_options)) ;
  +    %Embperl::initparam = (use_env => 1) ;
       }
   
   use Embperl;
  
  
  
  1.6       +10 -4     embperl/epcgiinit.c
  
  Index: epcgiinit.c
  ===================================================================
  RCS file: /home/cvs/embperl/epcgiinit.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- epcgiinit.c       14 Feb 2003 22:54:03 -0000      1.5
  +++ epcgiinit.c       15 Feb 2003 20:46:31 -0000      1.6
  @@ -65,9 +65,15 @@
   #define EPCFG_EXPIRES(STRUCT,TYPE,NAME,CFGNAME) \
       tainted = 0 ; \
       { \
  -    char buf [256] ; \
  -    pConfig -> NAME   = ep_pstrdup (pPool, embperl_CalcExpires (GetHashValueStr 
(aTHX_ pThread -> pEnvHash, REDIR"EMBPERL_"#CFGNAME, pConfig -> NAME), \
  -                                                                buf, 0)) ; \
  +    char buf [256] = "" ; \
  +    char * s       = GetHashValueStr (aTHX_ pThread -> pEnvHash, 
REDIR"EMBPERL_"#CFGNAME, NULL) ; \
  +    if (s) \
  +        {  \
  +        if (!embperl_CalcExpires (s, buf, 0)) \
  +            LogErrorParam (NULL, rcTimeFormatErr, "EMBPERL_"#CFGNAME, s) ; \
  +        else \
  +            pConfig -> NAME   = ep_pstrdup (pPool, buf) ; \
  +        } \
       } \
       tainted = 0 ; 
   
  
  
  
  1.7       +2 -3      embperl/epinit.c
  
  Index: epinit.c
  ===================================================================
  RCS file: /home/cvs/embperl/epinit.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- epinit.c  23 Dec 2002 10:08:54 -0000      1.6
  +++ epinit.c  15 Feb 2003 20:46:31 -0000      1.7
  @@ -553,7 +553,6 @@
           sAppName        = GetHashValueStr (aTHX_ pParam, "appname", NULL) ;
           }
   
  -
       if (!sAppName)
           {
   #ifdef APACHE
  @@ -600,6 +599,7 @@
                   bUseEnv         = (bool)GetHashValueInt (aTHX_ pParam, "use_env", 
0) ;
                   bUseRedirectEnv = (bool)GetHashValueInt (aTHX_ pParam, 
"use_redirect_env", 0) ;
                   }
  +
               embperl_GetCGIAppConfig (pThread, pPool, &pApp -> Config, bUseEnv, 
bUseRedirectEnv, 1) ;
               }
   
  @@ -613,7 +613,6 @@
   
           tainted = 0 ;
   
  -        
           if (pApp -> Config.sLog && pApp -> Config.sLog[0])
               {
               if ((rc = OpenLog (pApp)) != ok)
  
  
  
  1.121     +2 -1      embperl/epmain.c
  
  Index: epmain.c
  ===================================================================
  RCS file: /home/cvs/embperl/epmain.c,v
  retrieving revision 1.120
  retrieving revision 1.121
  diff -u -r1.120 -r1.121
  --- epmain.c  26 Nov 2002 10:03:41 -0000      1.120
  +++ epmain.c  15 Feb 2003 20:46:31 -0000      1.121
  @@ -178,6 +178,7 @@
           case rcApacheErr:               msg ="[%d]ERR:  %d: %s Apache returns 
Error: %s %s" ; break ; 
           case rcTooDeepNested:           msg ="[%d]ERR:  %d: %s Source data is too 
deep nested %s %s" ; break ; 
           case rcUnknownOption:           msg ="[%d]ERR:  %d: %s Unkown option '%s' 
in configuration directive '%s'" ; break ; 
  +        case rcTimeFormatErr:           msg ="[%d]ERR:  %d: %s Format error in %s = 
%s" ; break ;
   
        default:                        msg ="[%d]ERR:  %d: %s Error (no description) 
%s %s" ; break ; 
           }
  
  
  
  1.31      +30 -4     embperl/eputil.c
  
  Index: eputil.c
  ===================================================================
  RCS file: /home/cvs/embperl/eputil.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- eputil.c  14 Feb 2003 22:54:03 -0000      1.30
  +++ eputil.c  15 Feb 2003 20:46:32 -0000      1.31
  @@ -1926,6 +1926,33 @@
   
   /* parts from libareq */
   
  +#define Mult_s 1
  +#define Mult_m 60
  +#define Mult_h (60*60)
  +#define Mult_d (60*60*24)
  +#define Mult_M (60*60*24*30)
  +#define Mult_y (60*60*24*365)
  +
  +static int expire_mult(char s)
  +{
  +    switch (s) {
  +    case 's':
  +     return Mult_s;
  +    case 'm':
  +     return Mult_m;
  +    case 'h':
  +     return Mult_h;
  +    case 'd':
  +     return Mult_d;
  +    case 'M':
  +     return Mult_M;
  +    case 'y':
  +     return Mult_y;
  +    default:
  +     return 1;
  +    };
  +}
  +
   static time_t expire_calc(char *time_str)
   {
       int is_neg = 0, offset = 0;
  @@ -1939,15 +1966,14 @@
       else if (*time_str == '+') {
        ++time_str;
       }
  -    else if (strcaseEQ(time_str, "now")) {
  +    else if (stricmp(time_str, "now")) {
        /*ok*/
       }
       else {
        return 0;
       }
   
  -    /* wtf, ap_isdigit() returns false for '1' !? */
  -    while (*time_str && (ap_isdigit(*time_str) || (*time_str == '1'))) {
  +    while (*time_str && isdigit(*time_str)) {
        buf[ix++] = *time_str++;
       }
       buf[ix] = '\0';
  
  
  
  1.8       +5 -2      embperl/mod_embperl.c
  
  Index: mod_embperl.c
  ===================================================================
  RCS file: /home/cvs/embperl/mod_embperl.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mod_embperl.c     14 Feb 2003 22:54:03 -0000      1.7
  +++ mod_embperl.c     15 Feb 2003 20:46:32 -0000      1.8
  @@ -625,7 +625,10 @@
       { \
       apr_pool_t * p = cmd -> pool ;    \
       char buf[256] ; \
  -    ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = ap_pstrdup(p, 
embperl_CalcExpires(arg, buf, 0)) ; \
  +    if (!embperl_CalcExpires(arg, buf, 0)) \
  +        LogErrorParam (NULL, rcTimeFormatErr, "EMBPERL_"#CFGNAME, arg) ; \
  +    else \        
  +        ((tApacheDirConfig *)pDirCfg) -> STRUCT.NAME = ap_pstrdup(p, buf) ; \
       ((tApacheDirConfig *)pDirCfg) -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
           ap_log_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, APLOG_STATUSCODE 
NULL, "Embperl: Set "#CFGNAME" (type="#TYPE";STR) = %s\n", arg) ; \
  
  
  
  1.124     +5 -1      embperl/test.pl
  
  Index: test.pl
  ===================================================================
  RCS file: /home/cvs/embperl/test.pl,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- test.pl   28 Jan 2003 07:21:27 -0000      1.123
  +++ test.pl   15 Feb 2003 20:46:32 -0000      1.124
  @@ -485,6 +485,9 @@
           'condition'  => '$] >= 5.006001', 
           'cmpext'     => '.561',
           },
  +    'cookieexpire.htm' => { 
  +        'offline'    => 1,
  +        },
       'mdatsess.htm' => { 
           'offline'    => 0,
           'query_info' => 'cnt=0',
  @@ -1746,6 +1749,7 @@
   $cp -> share ('$testshare') ;
   
   $ENV{EMBPERL_ALLOW} = 'asc|\\.xml$|\\.htm$|\\.htm-1$' ;
  +$ENV{EMBPERL_COOKIE_EXPIRE} = '+120s' ;
   
   #Embperl::log ("Start testing...\n") ; # force logfile open
   
  
  
  
  1.1                  embperl/test/cmp/cookieexpire.htm
  
  Index: cookieexpire.htm
  ===================================================================
  
  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
  
  
  
  1.1                  embperl/test/html/cookieexpire.htm
  
  Index: cookieexpire.htm
  ===================================================================
  
  [- $r = shift -]
  
  app_name:       [+ $r -> app -> config -> app_name +]
  cookie_expires: [+ $r -> app -> config -> cookie_expires +]
  output_mode:  [+ $r -> config -> output_mode +]
  
  
  
  

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

Reply via email to