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/10 21:33:06 UTC
cvs commit: embperl/test/conf httpd.conf.src
richter 01/08/10 12:33:06
Modified: . Changes.pod Embperl.pm epmain.c
test/conf httpd.conf.src
Log:
%sdat sessions
Revision Changes Path
1.179 +3 -1 embperl/Changes.pod
Index: Changes.pod
===================================================================
RCS file: /home/cvs/embperl/Changes.pod,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -r1.178 -r1.179
--- Changes.pod 2001/08/10 14:06:41 1.178
+++ Changes.pod 2001/08/10 19:33:05 1.179
@@ -14,11 +14,13 @@
- Display correct Apache module name in Makefile.PL when
requesting path for Apache module. Patch from James Lee.
- New session handling using Apache::SessionX
+ - Fixed a bug that cause file-uploads to fail for the first
+ request to a file when running under EmbperlObject. Reported
+ by Thoren Johne.
- Added options optAddUserSessionToLinks, optAddStatusSessionToLinks
and optNoSessionCookies to control how the session id is passed.
- Added new hash %sdat which holds temporary sessins data.
-
=head1 1.3.3 (RELEASE) 6. Juni 2001
1.164 +5 -4 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- Embperl.pm 2001/07/18 14:30:21 1.163
+++ Embperl.pm 2001/08/10 19:33:05 1.164
@@ -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.163 2001/07/18 14:30:21 richter Exp $
+# $Id: Embperl.pm,v 1.164 2001/08/10 19:33:05 richter Exp $
#
###################################################################################
@@ -901,7 +901,8 @@
%fdat = %{$$req{'fdat'}} ;
@ffld = keys %fdat if (!defined ($$req{'ffld'})) ;
}
- elsif (!($optDisableFormData) &&
+ elsif (!defined ($import) &&
+ !($optDisableFormData) &&
!($r -> SubReq) &&
defined($ENV{'CONTENT_TYPE'}) &&
$ENV{'CONTENT_TYPE'}=~m|^multipart/form-data|)
@@ -1674,7 +1675,7 @@
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|&|:|$)/))
{
$sessid = $1 ;
print HTML::Embperl::LOG "[$$]SES: Received user session cookie $1\n" if ($HTML::Embperl::dbgSession) ;
@@ -1683,7 +1684,7 @@
$udat -> setid ($sessid) if (!$udat -> getid) ;
$mdat -> setidfrom ($Inputfile) if ($Inputfile && !$mdat -> getid) ;
- if (($ENV{QUERY_STRING} =~ /${cookie_name}s=(.*?)(\;|\s|&|$)/) || (defined ($cookie_val) && ($cookie_val =~ /${cookie_name}s=(.*?)(\;|\s|$)/)))
+ if (($ENV{QUERY_STRING} =~ /${cookie_name}=.*?:(.*?)(\;|\s|&|$)/) || (defined ($cookie_val) && ($cookie_val =~ /${cookie_name}s=(.*?)(\;|\s|$)/)))
{
$sessid = $1 ;
print HTML::Embperl::LOG "[$$]SES: Received status session cookie $1\n" if ($HTML::Embperl::dbgSession) ;
1.110 +11 -11 embperl/epmain.c
Index: epmain.c
===================================================================
RCS file: /home/cvs/embperl/epmain.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -r1.109 -r1.110
--- epmain.c 2001/08/10 14:06:42 1.109
+++ epmain.c 2001/08/10 19:33:05 1.110
@@ -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.109 2001/08/10 14:06:42 richter Exp $
+# $Id: epmain.c,v 1.110 2001/08/10 19:33:05 richter Exp $
#
###################################################################################*/
@@ -2137,6 +2137,7 @@
PUSHMARK(sp); /* remember the stack pointer */
XPUSHs(pUserHashObj) ; /* push pointer to obeject */
+ XPUSHs(sv_2mortal(newSViv(bReturnCookie?0:1))) ; /* init session if not for cookie */
PUTBACK;
n = perl_call_method ("getids", G_ARRAY) ; /* call the function */
SPAGAIN;
@@ -2171,7 +2172,7 @@
}
else if (ulen > 0 &&
((bModified && (ilen == 0 || strcmp (pInitialUID, pUID) !=0)) ||
- (r -> nSessionMgnt & 4)))
+ (r -> nSessionMgnt & 4) || !bReturnCookie))
{
if (bReturnCookie)
{
@@ -2184,7 +2185,7 @@
}
else
{
- pCookie = newSVpvf ("%s%s=%s", r -> pConf -> sCookieName, type == 's'?"s":"", pUID) ;
+ pCookie = pUID ;
}
}
}
@@ -2668,13 +2669,13 @@
if ((r -> bOptions & optAddStatusSessionToLinks) && !r -> bSubReq)
- {
+ {
SV * pCookie = CreateSessionCookie (r, r -> pStatusHash, 's', 0) ;
- if (pCookie)
+ STRLEN l ;
+ lprintf (r, "opt %x optadd %x options %x cookie %s\n", optAddStatusSessionToLinks, r -> bOptions & optAddStatusSessionToLinks, r -> bOptions, SvPV(pCookie, l)) ;
+ if (pCookie)
{
- STRLEN l ;
- r -> sSessionID = _ep_strdup (r, SvPV (pCookie, l)) ;
- SvREFCNT_dev (pCookie) ;
+ r -> sSessionID = _memstrcat (r, r -> pConf -> sCookieName, "=", SvPV (pCookie, l), NULL) ;
}
}
@@ -2685,10 +2686,9 @@
{
STRLEN l ;
if (r -> sSessionID)
- r -> sSessionID = _memstrcat (r, r -> sSessionID, "&", SvPV (pCookie, l)) ;
+ r -> sSessionID = _memstrcat (r, r -> sSessionID, ":", SvPV (pCookie, l), NULL) ;
else
- r -> sSessionID = _ep_strdup (r, SvPV (pCookie, l)) ;
- SvREFCNT_dev (pCookie) ;
+ r -> sSessionID = _memstrcat (r, r -> pConf -> sCookieName, "=:", SvPV (pCookie, l), NULL) ;
}
}
1.41 +14 -0 embperl/test/conf/httpd.conf.src
Index: httpd.conf.src
===================================================================
RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- httpd.conf.src 2001/06/05 04:56:22 1.40
+++ httpd.conf.src 2001/08/10 19:33:06 1.41
@@ -426,6 +426,20 @@
EOD
}
+if ($EPSESSIONVERSION)
+ {
+print OFH <<EOD ;
+<Location /embperl/sidurl>
+SetHandler perl-script
+PerlHandler HTML::Embperl
+Options ExecCGI
+#PerlSetEnv EMBPERL_OPTIONS 0x7000000
+PerlSetEnv EMBPERL_OPTIONS 0x6000000
+</Location>
+EOD
+
+ }
+
print OFH <<EOD ;
<IfModule mod_jserv.c>
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org