[LON-CAPA-cvs] cvs: loncom / lond

raeburn raeburn at source.lon-capa.org
Fri Jan 2 21:34:37 EST 2015


raeburn		Sat Jan  3 02:34:37 2015 EDT

  Modified files:              
    /loncom	lond 
  Log:
  - &newput_user_profile_entry() needs to untie hash in case where hash had
    been tied but put failed because new key already exists.
  
  
Index: loncom/lond
diff -u loncom/lond:1.512 loncom/lond:1.513
--- loncom/lond:1.512	Mon Nov 24 02:36:16 2014
+++ loncom/lond	Sat Jan  3 02:34:36 2015
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.512 2014/11/24 02:36:16 raeburn Exp $
+# $Id: lond,v 1.513 2015/01/03 02:34:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -61,7 +61,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.512 $'; #' stupid emacs
+my $VERSION='$Revision: 1.513 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid="default";
 my $currentdomainid;
@@ -2808,8 +2808,12 @@
     foreach my $pair (@pairs) {
 	my ($key,$value)=split(/=/,$pair);
 	if (exists($hashref->{$key})) {
-	    &Failure($client, "key_exists: ".$key."\n",$userinput);
-	    return 1;
+            if (!&untie_user_hash($hashref)) {
+                &logthis("error: ".($!+0)." untie (GDBM) failed ".
+                         "while attempting newput - early out as key exists");
+            }
+            &Failure($client, "key_exists: ".$key."\n",$userinput);
+            return 1;
 	}
     }
 




More information about the LON-CAPA-cvs mailing list