[interchange-cvs] interchange - heins modified lib/Vend/Ship.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Wed Jan 18 12:48:17 EST 2006
User: heins
Date: 2006-01-18 17:48:17 GMT
Modified: lib/Vend Tag: STABLE_5_4-branch Ship.pm
Log:
* Fix thread-safety problem with shipping adder (and potentially other
things).
Revision Changes Path
No revision
No revision
2.13.2.1 +12 -5 interchange/lib/Vend/Ship.pm
rev 2.13.2.1, prev_rev 2.13
Index: Ship.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Ship.pm,v
retrieving revision 2.13
retrieving revision 2.13.2.1
diff -u -r2.13 -r2.13.2.1
--- Ship.pm 9 Jun 2005 18:43:58 -0000 2.13
+++ Ship.pm 18 Jan 2006 17:48:17 -0000 2.13.2.1
@@ -1,6 +1,6 @@
# Vend::Ship - Interchange shipping code
#
-# $Id: Ship.pm,v 2.13 2005/06/09 18:43:58 docelic Exp $
+# $Id: Ship.pm,v 2.13.2.1 2006/01/18 17:48:17 mheins Exp $
#
# Copyright (C) 2002-2005 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -574,7 +574,11 @@
}
}
- my $o = get_option_hash($lines[0][OPT]) || {};
+ my $lopt = $lines[0][OPT];
+ if(ref($lopt) eq 'HASH') {
+ $lopt = { %$lopt };
+ }
+ my $o = get_option_hash($lopt) || {};
#::logDebug("shipping opt=" . uneval($o));
@@ -692,8 +696,12 @@
$row->[CRIT] !~ /\S/;
}
- $o = get_option_hash($row->[OPT], $o)
- if $row->[OPT];
+ my $ropt = $row->[OPT];
+ if(ref($ropt) eq 'HASH' ) {
+ $ropt = { %$ropt };
+ }
+ $o = get_option_hash($ropt, $o)
+ if $ropt;
# unless field begins with 'x' or 'f', straight cost is returned
# - otherwise the quantity is multiplied by the cost or a formula
# is applied
@@ -852,7 +860,6 @@
$o->{free} = interpolate_html($o->{free}) if $o->{free} =~ /[_@[]/;
unless ($o->{free}) {
return '' if $final == 0;
- $o->{adder} =~ s/\bx\b/$final/g;
$o->{adder} =~ s/\@\@TOTAL\@\\?\@/$final/g;
$o->{adder} =~ s/\@\@CRIT\@\\?\@/$total/g;
$o->{adder} = $Vend::Interpolate::ready_safe->reval($o->{adder});
More information about the interchange-cvs
mailing list