[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r10049: Avoid another exception when shutting down from torctl. (in torctl/trunk: . java/net/freehaven/tor/control)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r10049: Avoid another exception when shutting down from torctl. (in torctl/trunk: . java/net/freehaven/tor/control)
- From: nickm@xxxxxxxx
- Date: Sun, 29 Apr 2007 22:35:33 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Sun, 29 Apr 2007 22:35:48 -0400
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: nickm
Date: 2007-04-29 22:35:32 -0400 (Sun, 29 Apr 2007)
New Revision: 10049
Modified:
torctl/trunk/
torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java
Log:
r12551@catbus: nickm | 2007-04-29 22:35:30 -0400
Avoid another exception when shutting down from torctl.
Property changes on: torctl/trunk
___________________________________________________________________
svk:merge ticket from /torctl/trunk [r12551] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java
===================================================================
--- torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java 2007-04-30 02:31:08 UTC (rev 10048)
+++ torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java 2007-04-30 02:35:32 UTC (rev 10049)
@@ -399,22 +399,24 @@
String cmd = "SIGNAL " + signal + "\r\n";
sendAndWaitForResponse(cmd, null);
}
-
+
/** Send a signal to the Tor process to shut it down or halt it.
* Does not wait for a response. */
- public void shutdownTor(String signal) throws IOException {
- String s = "SIGNAL " + signal + "\r\n";
+ public void shutdownTor(String signal) throws IOException {
+ String s = "SIGNAL " + signal + "\r\n";
+ Waiter w = new Waiter();
if (debugOutput != null)
debugOutput.print(">> "+s);
if (this.thread != null) {
- this.thread.stopListening();
+ this.thread.stopListening();
}
synchronized (waiters) {
output.write(s);
output.flush();
- }
+ waiters.addLast(w); // Prevent react() from finding the list empty
}
-
+ }
+
/** Tells the Tor server that future SOCKS requests for connections to a set of original
* addresses should be replaced with connections to the specified replacement
* addresses. Each element of <b>kvLines</b> is a String of the form