You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/08/12 14:19:33 UTC
cvs commit: embperl Embperl.pm embperl.h epdat.h epio.c epmain.c
richter 01/08/12 05:19:32
Modified: . Embperl.pm embperl.h epdat.h epio.c epmain.c
Log:
%sdat
Revision Changes Path
1.165 +7 -11 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.164
retrieving revision 1.165
diff -u -r1.164 -r1.165
--- Embperl.pm 2001/08/10 19:33:05 1.164
+++ Embperl.pm 2001/08/12 12:19:32 1.165
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.164 2001/08/10 19:33:05 richter Exp $
+# $Id: Embperl.pm,v 1.165 2001/08/12 12:19:32 richter Exp $
#
###################################################################################
@@ -1671,26 +1671,22 @@
my $udat = tied(%HTML::Embperl::udat) ;
my $mdat = tied(%HTML::Embperl::mdat) ;
my $sdat = tied(%HTML::Embperl::sdat) ;
- my $sessid ;
my $cookie_name = $r?$r -> CookieName:$ENV{EMBPERL_COOKIE_NAME} || 'EMBPERL_UID' ;
my $cookie_val = $ENV{HTTP_COOKIE} || ($req_rec?$req_rec->header_in('Cookie'):undef) ;
- if ((defined ($cookie_val) && ($cookie_val =~ /$cookie_name=(.*?)(\;|\s|$)/)) || ($ENV{QUERY_STRING} =~ /$cookie_name=(.*?)(\;|\s|&|:|$)/))
+ if ((defined ($cookie_val) && ($cookie_val =~ /$cookie_name=(.*?)(\;|\s|$)/)) || ($ENV{QUERY_STRING} =~ /$cookie_name=(.*?)(\;|\s|&|:|$)/) || $ENV{EMBPERL_UID} )
{
- $sessid = $1 ;
- print HTML::Embperl::LOG "[$$]SES: Received user session cookie $1\n" if ($HTML::Embperl::dbgSession) ;
+ print HTML::Embperl::LOG "[$$]SES: Received user session id $1\n" if ($HTML::Embperl::dbgSession) ;
+ $udat -> setid ($1) if (!$udat -> getid) ;
}
- $udat -> setid ($sessid) if (!$udat -> getid) ;
$mdat -> setidfrom ($Inputfile) if ($Inputfile && !$mdat -> getid) ;
- if (($ENV{QUERY_STRING} =~ /${cookie_name}=.*?:(.*?)(\;|\s|&|$)/) || (defined ($cookie_val) && ($cookie_val =~ /${cookie_name}s=(.*?)(\;|\s|$)/)))
+ if (($ENV{QUERY_STRING} =~ /${cookie_name}=.*?:(.*?)(\;|\s|&|$)/))
{
- $sessid = $1 ;
- print HTML::Embperl::LOG "[$$]SES: Received status session cookie $1\n" if ($HTML::Embperl::dbgSession) ;
+ print HTML::Embperl::LOG "[$$]SES: Received state session id $1\n" if ($HTML::Embperl::dbgSession) ;
+ $sdat -> setid ($1) if (!$sdat -> getid) ;
}
-
- $sdat -> setid ($sessid) if (!$sdat -> getid) ;
}
else
{
1.27 +2 -2 embperl/embperl.h
Index: embperl.h
===================================================================
RCS file: /home/cvs/embperl/embperl.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- embperl.h 2001/08/10 14:06:42 1.26
+++ embperl.h 2001/08/12 12:19:32 1.27
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: embperl.h,v 1.26 2001/08/10 14:06:42 richter Exp $
+# $Id: embperl.h,v 1.27 2001/08/12 12:19:32 richter Exp $
#
###################################################################################*/
@@ -144,7 +144,7 @@
optNoUncloseWarn = 0x400000,
optDisableSelectScan = 0x800000,
optAddUserSessionToLinks = 0x1000000,
- optAddStatusSessionToLinks = 0x2000000,
+ optAddStateSessionToLinks = 0x2000000,
optNoSessionCookies = 0x4000000
} ;
1.34 +2 -2 embperl/epdat.h
Index: epdat.h
===================================================================
RCS file: /home/cvs/embperl/epdat.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- epdat.h 2001/08/10 14:06:42 1.33
+++ epdat.h 2001/08/12 12:19:32 1.34
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdat.h,v 1.33 2001/08/10 14:06:42 richter Exp $
+# $Id: epdat.h,v 1.34 2001/08/12 12:19:32 richter Exp $
#
###################################################################################*/
@@ -521,7 +521,7 @@
HV * pInputHash ; /* Data of input fields */
AV * pFormArray ; /* Fieldnames */
HV * pUserHash ; /* Session User data */
- HV * pStatusHash ;/* Session Status data */
+ HV * pStateHash ; /* Session State data */
HV * pModHash ; /* Module data */
HV * pHeaderHash ;/* http headers */
#ifdef EP2
1.18 +6 -4 embperl/epio.c
Index: epio.c
===================================================================
RCS file: /home/cvs/embperl/epio.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- epio.c 2001/02/13 05:39:22 1.17
+++ epio.c 2001/08/12 12:19:32 1.18
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epio.c,v 1.17 2001/02/13 05:39:22 richter Exp $
+# $Id: epio.c,v 1.18 2001/08/12 12:19:32 richter Exp $
#
###################################################################################*/
@@ -1143,7 +1143,8 @@
sum = 0 ;
while (p)
{
- sum += va_arg (ap, int) ;
+ sum += strlen (p) ;
+ lprintf (r, "sum = %d p = %s\n", sum, p) ;
p = va_arg (ap, char *) ;
}
sum++ ;
@@ -1157,8 +1158,9 @@
p = (char *)s ;
while (p)
{
- l = va_arg (ap, int) ;
- memcpy (str, p, l) ;
+ l = strlen (p) ;
+ lprintf (r, "l = %d p = %s\n", l, p) ;
+ memcpy (str, p, l) ;
str += l ;
p = va_arg (ap, char *) ;
}
1.111 +13 -12 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- epmain.c 2001/08/10 19:33:05 1.110
+++ epmain.c 2001/08/12 12:19:32 1.111
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epmain.c,v 1.110 2001/08/10 19:33:05 richter Exp $
+# $Id: epmain.c,v 1.111 2001/08/12 12:19:32 richter Exp $
#
###################################################################################*/
@@ -29,7 +29,7 @@
static char sEnvHashName [] = "ENV" ;
static char sFormHashName [] = "HTML::Embperl::fdat" ;
static char sUserHashName [] = "HTML::Embperl::udat" ;
-static char sStatusHashName [] = "HTML::Embperl::sdat" ;
+static char sStateHashName [] = "HTML::Embperl::sdat" ;
static char sModHashName [] = "HTML::Embperl::mdat" ;
static char sFormSplitHashName [] = "HTML::Embperl::fsplitdat" ;
static char sFormArrayName [] = "HTML::Embperl::ffld" ;
@@ -1453,7 +1453,7 @@
return 1 ;
}
- if ((r -> pStatusHash = perl_get_hv (sStatusHashName, TRUE)) == NULL)
+ if ((r -> pStateHash = perl_get_hv (sStateHashName, TRUE)) == NULL)
{
LogError (r, rcHashError) ;
return 1 ;
@@ -2117,6 +2117,7 @@
{
SV ** ppSVID ;
SV * pSVID = NULL ;
+ SV * pSVUID = NULL ;
MAGIC * pMG ;
char * pUID = NULL ;
char * pInitialUID = NULL ;
@@ -2146,9 +2147,9 @@
int savewarn = dowarn ;
dowarn = 0 ; /* no warnings here */
bModified = POPi ;
+ pSVUID = POPs;
+ pUID = SvPV (pSVUID, ulen) ;
pSVID = POPs;
- pUID = SvPV (pSVID, ulen) ;
- pSVID = POPs;
pInitialUID = SvPV (pSVID, ilen) ;
dowarn = savewarn ;
}
@@ -2156,7 +2157,7 @@
}
if (r -> bDebug & dbgSession)
- lprintf (r, "[%d]SES: Received Cookie ID: %s New Cookie ID: %s %s data is%s modified\n", r -> nPid, pInitialUID, pUID, type == 's'?"Status":"User", bModified?"":" NOT") ;
+ lprintf (r, "[%d]SES: Received Cookie ID: %s New Cookie ID: %s %s data is%s modified\n", r -> nPid, pInitialUID, pUID, type == 's'?"State":"User", bModified?"":" NOT") ;
if (ilen > 0 && (ulen == 0 || (!bModified && strcmp ("!DELETE", pInitialUID) == 0)))
{ /* delete cookie */
@@ -2185,7 +2186,7 @@
}
else
{
- pCookie = pUID ;
+ pCookie = pSVUID ;
}
}
}
@@ -2668,11 +2669,11 @@
}
- if ((r -> bOptions & optAddStatusSessionToLinks) && !r -> bSubReq)
+ if ((r -> bOptions & optAddStateSessionToLinks) && !r -> bSubReq)
{
- SV * pCookie = CreateSessionCookie (r, r -> pStatusHash, 's', 0) ;
+ SV * pCookie = CreateSessionCookie (r, r -> pStateHash, 's', 0) ;
STRLEN l ;
- lprintf (r, "opt %x optadd %x options %x cookie %s\n", optAddStatusSessionToLinks, r -> bOptions & optAddStatusSessionToLinks, r -> bOptions, SvPV(pCookie, l)) ;
+ lprintf (r, "opt %x optadd %x options %x cookie %s\n", optAddStateSessionToLinks, r -> bOptions & optAddStateSessionToLinks, r -> bOptions, SvPV(pCookie, l)) ;
if (pCookie)
{
r -> sSessionID = _memstrcat (r, r -> pConf -> sCookieName, "=", SvPV (pCookie, l), NULL) ;
@@ -2681,7 +2682,7 @@
if ((r -> bOptions & optAddUserSessionToLinks) && !r -> bSubReq)
{
- SV * pCookie = CreateSessionCookie (r, r -> pStatusHash, 'u', 0) ;
+ SV * pCookie = CreateSessionCookie (r, r -> pUserHash, 'u', 0) ;
if (pCookie)
{
STRLEN l ;
@@ -2771,7 +2772,7 @@
{
if (!(r -> bOptions & optNoSessionCookies))
pCookie = CreateSessionCookie (r, r -> pUserHash, 'u', 1) ;
- /* pCookie2 = CreateSessionCookie (r, r -> pStatusHash, 's') ; */
+ /* pCookie2 = CreateSessionCookie (r, r -> pStateHash, 's') ; */
#ifdef APACHE
if (r -> pApacheReq)
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org