[or-cvs] r10045: changed some configurations, set most log statements to INFO (in puppetor/trunk: doc src/de/uniba/wiai/lspi/puppetor/impl)

kloesing at seul.org kloesing at seul.org
Sun Apr 29 20:16:00 UTC 2007


Author: kloesing
Date: 2007-04-29 16:15:53 -0400 (Sun, 29 Apr 2007)
New Revision: 10045

Modified:
   puppetor/trunk/doc/howto.tex
   puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/DirectoryNodeImpl.java
   puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
   puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ServerApplicationImpl.java
Log:
changed some configurations, set most log statements to INFO, replaced System.out.println()s by logging, updated howto

Modified: puppetor/trunk/doc/howto.tex
===================================================================
--- puppetor/trunk/doc/howto.tex	2007-04-29 20:13:57 UTC (rev 10044)
+++ puppetor/trunk/doc/howto.tex	2007-04-29 20:15:53 UTC (rev 10045)
@@ -71,10 +71,7 @@
 
 PuppeTor requires a Tor executable and the Java Tor Controller API which can
 both be downloaded from the Subversion repository on the Tor
-homepage.\footnote{At the moment the Tor Controller API is included, because we
-had to make some changes to the Tor Controller code, so that the framework does
-not run with the current Tor Controller code. Maybe we should make these changes
-(bugs?) to the Tor Controller API before?}
+homepage.
 
 After downloading, you need to put the Tor executable to the base directory of
 this framework and make sure that it has the name \texttt{tor.exe} or
@@ -494,9 +491,24 @@
 network.shutdownNodes();
 \end{verbatim}
 
+\section{Architecture}
+
+Though the examples show how to use the simulator, they do not provide insights
+into the architecture of the implementation. This section will explain some
+design decisions.
+
+Every Tor process has the following input and output ports to which we connect:
+\begin{enumerate}
+  \item Standard out/err
+  \item Control port
+  \item SOCKS port
+  \item OR port
+  \item Dir port
+\end{enumerate}
+
 \section{Known issues}
 
-There is already a small list of problems and open questiosn that require more
+There is already a small list of problems and open questions that require more
 investigation:
 
 \begin{itemize}

Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/DirectoryNodeImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/DirectoryNodeImpl.java	2007-04-29 20:13:57 UTC (rev 10044)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/DirectoryNodeImpl.java	2007-04-29 20:15:53 UTC (rev 10045)
@@ -30,7 +30,7 @@
 		// TODO make this a little bit more configurable---same as to
 		// location of tor.exe?
 		this.configuration
-				.add("RecommendedVersions 0.1.2.12-rc,0.1.2.7-alpha-dev");
+				.add("RecommendedVersions 0.1.2.12-rc,0.1.2.7-alpha-dev,0.2.0.0-alpha-dev");
 
 		this.configuration.add("VersioningAuthoritativeDirectory 1");
 

Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java	2007-04-29 20:13:57 UTC (rev 10044)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ProxyNodeImpl.java	2007-04-29 20:15:53 UTC (rev 10045)
@@ -162,6 +162,7 @@
 		// TODO setting log level to lower level than NOTICE leads to error when
 		// connecting via control port! why?
 		this.configuration.add("Log notice stdout");
+		this.configuration.add("Log debug file log");
 
 		// allow two nodes on the same circuit to be in the same /16 net
 		// TODO this depends in private or public network setting!!!
@@ -315,7 +316,7 @@
 					// don't throw this exception, nobody will catch it!
 					String reason = "IOException when reading output from Tor "
 							+ "process!";
-					logger.log(Level.WARNING, reason, e);
+					logger.log(Level.FINE, reason, e);
 				}
 
 				// log exiting
@@ -366,6 +367,13 @@
 				"Tor has successfully opened its control port and told us "
 						+ "about that!");
 
+		// be sure that Tor is ready, especially if computer is very busy and
+		// many nodes are created
+		try {
+			Thread.sleep(1000);
+		} catch (InterruptedException e2) {
+		}
+		
 		// connect to the controller
 		this.logger.log(Level.FINER, "Connecting to control port...");
 		try {
@@ -375,7 +383,7 @@
 		} catch (IOException e) {
 
 			// prepare and throw exception
-			String reason = "Could not connect to control port!";
+			String reason = "Could not connect to control port " + controlPort + "!";
 			TorProcessException e1 = new TorProcessException(reason, e);
 			this.logger.log(Level.SEVERE, reason, e1);
 			this.logger.throwing(this.getClass().getName(), "startNode", e1);
@@ -503,8 +511,7 @@
 
 		// add hidden service using Tor controller
 		this.configuration.add("HiddenServiceDir "
-				+ workingDir.getAbsolutePath() + "/" + serviceName);
-		this.configuration.add("HiddenServicePort " + virtualPort
+				+ workingDir.getAbsolutePath() + File.separator + serviceName + "\nHiddenServicePort " + virtualPort
 				+ " 127.0.0.1:" + servicePort);
 
 	}
@@ -593,7 +600,6 @@
 		// closed socket as failure and throw a RuntimeException
 		// TODO who cares?!
 		try {
-			this.conn.stopThread();
 			this.conn.shutdownTor("SHUTDOWN");
 			this.conn.shutdownTor("SHUTDOWN");
 		} catch (IOException e) {
@@ -630,7 +636,7 @@
 
 		// should we check whether conn is null?
 		if (this.conn == null) {
-			System.out.println("WARNING! conn is null!");
+			this.logger.log(Level.WARNING, "WARNING! conn is null!");
 		}
 		try {
 			// TODO sometimes, this throws a NullPointerException...

Modified: puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ServerApplicationImpl.java
===================================================================
--- puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ServerApplicationImpl.java	2007-04-29 20:13:57 UTC (rev 10044)
+++ puppetor/trunk/src/de/uniba/wiai/lspi/puppetor/impl/ServerApplicationImpl.java	2007-04-29 20:15:53 UTC (rev 10045)
@@ -153,10 +153,10 @@
 				try {
 					serverSocket = new ServerSocket(serverPort);
 				} catch (IOException ioe) {
-					System.out.println("Can't open server socket on port "
+					logger.log(Level.WARNING, "Can't open server socket on port "
 							+ serverPort + "!");
 				}
-				System.out.println("Listening on port " + serverPort + "...");
+				logger.log(Level.FINE, "Listening on port " + serverPort + "...");
 				while (connected) {
 					try {
 						Socket incomingConnection = serverSocket.accept();



More information about the tor-commits mailing list