[LON-CAPA-cvs] cvs: loncom(Refactoring) / lond

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 19 Apr 2004 11:28:18 -0000


foxr		Mon Apr 19 07:28:18 2004 EDT

  Modified files:              (Branch: Refactoring)
    /loncom	lond 
  Log:
  Append pid to tmp ids to avoid collisions with multiple lond's assigning the same temp id to
  different temp files.
  
  
  
Index: loncom/lond
diff -u loncom/lond:1.178.2.16 loncom/lond:1.178.2.17
--- loncom/lond:1.178.2.16	Thu Apr 15 07:26:34 2004
+++ loncom/lond	Mon Apr 19 07:28:18 2004
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # lond "LON Daemon" Server (port "LOND" 5663)
 #
-# $Id: lond,v 1.178.2.16 2004/04/15 11:26:34 foxr Exp $
+# $Id: lond,v 1.178.2.17 2004/04/19 11:28:18 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -53,7 +53,7 @@
 my $status='';
 my $lastlog='';
 
-my $VERSION='$Revision: 1.178.2.16 $'; #' stupid emacs
+my $VERSION='$Revision: 1.178.2.17 $'; #' stupid emacs
 my $remoteVERSION;
 my $currenthostid;
 my $currentdomainid;
@@ -2221,19 +2221,24 @@
     }
     unless (defined($since)) { $since=0; }
     my $qresult='';
-
+    logthis(" Looking for $description  since $since");
     my $hashref = TieDomainHash($udom, "nohist_courseids", &GDBM_WRCREAT());
     if ($hashref) {
 	while (my ($key,$value) = each(%$hashref)) {
 	    my ($descr,$lasttime)=split(/\:/,$value);
+	    logthis("Got:  key = $key descr = $descr time: $lasttime");
 	    if ($lasttime<$since) { 
+		logthis("Skipping .. too early");
 		next; 
 	    }
 	    if ($description eq '.') {
+		logthis("Adding wildcard match");
 		$qresult.=$key.'='.$descr.'&';
 	    } else {
 		my $unescapeVal = &unescape($descr);
+		logthis("Matching with $unescapeVal");
 		if (eval('$unescapeVal=~/$description/i')) {
+		    logthis("Adding on match");
 		    $qresult.="$key=$descr&";
 		}
 	    }
@@ -2380,7 +2385,8 @@
 
     my $store;
     $tmpsnum++;
-    my $id=$$.'_'.$clientip.'_'.$tmpsnum;
+    my $pid = $$;
+    my $id=$$.'_'.$clientip.'_'.$tmpsnum.'_'.$pid;
     $id=~s/\W/\_/g;
     $what=~s/\n//g;
     my $execdir=$perlvar{'lonDaemons'};