--- loncom/lond 2006/02/07 16:20:39 1.318 +++ loncom/lond 2006/02/09 20:23:28 1.318.2.1 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.318 2006/02/07 16:20:39 albertel Exp $ +# $Id: lond,v 1.318.2.1 2006/02/09 20:23:28 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,7 +61,7 @@ my $status=''; my $lastlog=''; my $lond_max_wait_time = 13; -my $VERSION='$Revision: 1.318 $'; #' stupid emacs +my $VERSION='$Revision: 1.318.2.1 $'; #' stupid emacs my $remoteVERSION; my $currenthostid="default"; my $currentdomainid; @@ -3068,10 +3068,11 @@ sub store_handler { my $version=$hashref->{"version:$rid"}; my $allkeys=''; foreach my $pair (@pairs) { - my ($key,$value)=split(/=/,$pair); + my ($key)=split(/=/,$pair); $allkeys.=$key.':'; - $hashref->{"$version:$rid:$key"}=$value; } + $hashref->{"$version:$rid"}=$what; + $hashref->{"$version:$rid:timestamp"}=$now; $allkeys.='timestamp'; $hashref->{"$version:keys:$rid"}=$allkeys; @@ -3138,9 +3139,17 @@ sub restore_handler { my @keys=split(/:/,$vkeys); my $key; $qresult.="$scope:keys=$vkeys&"; - foreach $key (@keys) { - $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&"; - } + if (exists($hashref->{"$scope:$rid"})) { + my $what=$hashref->{"$scope:$rid"}; + foreach my $pair (split(/\&/,$hashref->{"$scope:$rid"})) { + my ($key,$value)=split(/=/,$pair); + $qresult.="$scope:".$pair."&"; + } + } else { + foreach $key (@keys) { + $qresult.="$scope:$key=".$hashref->{"$scope:$rid:$key"}."&"; + } + } } if (&untie_user_hash($hashref)) { $qresult=~s/\&$//;