[or-cvs] r19508: {torstatus} added debbuging output to the database connection (torstatus/trunk)

mmulazzani at seul.org mmulazzani at seul.org
Wed May 13 12:01:16 UTC 2009


Author: mmulazzani
Date: 2009-05-13 08:01:16 -0400 (Wed, 13 May 2009)
New Revision: 19508

Modified:
   torstatus/trunk/tns_update.pl
Log:
added debbuging output to the database connection


Modified: torstatus/trunk/tns_update.pl
===================================================================
--- torstatus/trunk/tns_update.pl	2009-05-12 17:14:43 UTC (rev 19507)
+++ torstatus/trunk/tns_update.pl	2009-05-13 12:01:16 UTC (rev 19508)
@@ -121,11 +121,19 @@
 }
 
 # Initiate a connection to the MySQL server
-$dbh = DBI->connect('DBI:mysql:database='.$config{'SQL_Catalog'}.';host='.$config{'SQL_Server'},$config{'SQL_User'},$config{'SQL_Pass'}, {
-	PrintError => 0,
-	RaiseError => 1
-}) or die "Unable to connect to MySQL server";
+if ($debugging == 1) {
+	$dbh = DBI->connect('DBI:mysql:database='.$config{'SQL_Catalog'}.';host='.$config{'SQL_Server'},$config{'SQL_User'},$config{'SQL_Pass'}, {
+		PrintError => 1,
+		RaiseError => 1
+	}) or die "Unable to connect to MySQL server";
+} else {
+	$dbh = DBI->connect('DBI:mysql:database='.$config{'SQL_Catalog'}.';host='.$config{'SQL_Server'},$config{'SQL_User'},$config{'SQL_Pass'}, {
+        	PrintError => 0,
+	        RaiseError => 1
+	}) or die "Unable to connect to MySQL server";
+}
 
+
 $query;
 $dbresponse;
 $record;



More information about the tor-commits mailing list