[interchange-cvs] interchange - jon modified lib/Vend/Dispatch.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu May 13 18:41:22 EDT 2004


User:      jon
Date:      2004-05-13 22:41:22 GMT
Modified:  lib/Vend Dispatch.pm
Log:
Fix IMO a major problem with thread-safety in PreFork or mod_perl modes:
Any change to %$Variable persists between page views for the life of that
child process, because the hash access happens outside the control of
Tie::ShadowHash (which controls $Vend::Cfg).

Apparently this was already noticed and fixed for %$Pragma, so if there's
a reason this shouldn't be done with %$Variable, we'll have to figure out
some other fix, because the current behavior is very dangerous.

Revision  Changes    Path
1.40      +3 -3      interchange/lib/Vend/Dispatch.pm


rev 1.40, prev_rev 1.39
Index: Dispatch.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Dispatch.pm,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -u -r1.39 -r1.40
--- Dispatch.pm	16 Apr 2004 16:31:04 -0000	1.39
+++ Dispatch.pm	13 May 2004 22:41:22 -0000	1.40
@@ -1,6 +1,6 @@
 # Vend::Dispatch - Handle Interchange page requests
 #
-# $Id: Dispatch.pm,v 1.39 2004/04/16 16:31:04 mheins Exp $
+# $Id: Dispatch.pm,v 1.40 2004/05/13 22:41:22 jon Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 2002 Mike Heins <mike at perusion.net>
@@ -26,7 +26,7 @@
 package Vend::Dispatch;
 
 use vars qw($VERSION);
-$VERSION = substr(q$Revision: 1.39 $, 10);
+$VERSION = substr(q$Revision: 1.40 $, 10);
 
 use POSIX qw(strftime);
 use Vend::Util;
@@ -995,7 +995,7 @@
 		}
 	}
 
-	$::Variable = $Vend::Cfg->{Variable};
+	$::Variable = { %{ $Vend::Cfg->{Variable} } };
 	$::Pragma   = { %{ $Vend::Cfg->{Pragma} } };
 
 	my $mt;








More information about the interchange-cvs mailing list