[or-cvs] r14714: (ticket 75) Reverting back to original flag handling (torstatus/trunk)

kasimir at seul.org kasimir at seul.org
Sun May 25 03:57:15 UTC 2008


Author: kasimir
Date: 2008-05-24 23:57:15 -0400 (Sat, 24 May 2008)
New Revision: 14714

Modified:
   torstatus/trunk/tns_update.pl
Log:
(ticket 75) Reverting back to original flag handling

Modified: torstatus/trunk/tns_update.pl
===================================================================
--- torstatus/trunk/tns_update.pl	2008-05-25 03:39:57 UTC (rev 14713)
+++ torstatus/trunk/tns_update.pl	2008-05-25 03:57:15 UTC (rev 14714)
@@ -632,7 +632,7 @@
 unless ($response =~ /250+/) { die "There was an error retrieving the network status."; }
 
 # Prepare the query so that data entry is faster
-$query = "INSERT INTO NetworkStatus${descriptorTable} (Name,Fingerprint,DescriptorHash,LastDescriptorPublished,IP,Hostname,ORPort,DirPort,CountryCode,Flags) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ?);";
+$query = "INSERT INTO NetworkStatus${descriptorTable} (Name,Fingerprint,DescriptorHash,LastDescriptorPublished,IP,Hostname,ORPort,DirPort,FAuthority,FBadDirectory,FBadExit,FExit,FFast,FGuard,FNamed,FStable,FRunning,FValid,FV2Dir,FHSDir,CountryCode) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?);";
 $dhresponse = $dbh->prepare($query);
 
 while (<$torSocket>)
@@ -655,13 +655,13 @@
 		if ($currentRouter{'Nickname'})
 		{
 			# Form the Flags list
-			$currentRouter{'flags'} = "0b";
-			my @flagorder = split(',',$config{'FlagOrder'});
-			foreach my $flag (@flagorder)
-			{
-				$currentRouter{'flags'} .= ($currentRouter{$flag}?1:0);
-			}
-			$currentRouter{'flags'} = oct($currentRouter{'flags'});
+#			$currentRouter{'flags'} = "0b";
+#			my @flagorder = split(',',$config{'FlagOrder'});
+#			foreach my $flag (@flagorder)
+#			{
+#				$currentRouter{'flags'} .= ($currentRouter{$flag}?1:0);
+#			}
+#			$currentRouter{'flags'} = oct($currentRouter{'flags'});
 			unless ($currentRouter{'Country'})
 			{
 				$currentRouter{'Country'} = "NA";
@@ -675,8 +675,19 @@
 			 $currentRouter{'Hostname'},
 			 $currentRouter{'ORPort'},
 			 $currentRouter{'DirPort'},
-			 $currentRouter{'Country'},
-			 $currentRouter{'flags'}
+			 ($currentRouter{'Authority'}?1:0),
+			 ($currentRouter{'BadDirectory'}?1:0),
+			 ($currentRouter{'BadExit'}?1:0),
+			 ($currentRouter{'Exit'}?1:0),
+			 ($currentRouter{'Fast'}?1:0),
+			 ($currentRouter{'Guard'}?1:0),
+			 ($currentRouter{'Named'}?1:0),
+			 ($currentRouter{'Stable'}?1:0),
+			 ($currentRouter{'Running'}?1:0),
+			 ($currentRouter{'Valid'}?1:0),
+			 ($currentRouter{'V2Dir'}?1:0),
+			 ($currentRouter{'HSDir'}?1:0),
+			 $currentRouter{'Country'}
 			);
 		
 			# Clear the old data



More information about the tor-commits mailing list