[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix a couple of bugs found by Oliver Rau in Java libs.



Update of /home/or/cvsroot/control/java/net/freehaven/tor/control
In directory moria:/tmp/cvs-serv23806/java/net/freehaven/tor/control

Modified Files:
	TorControlConnection0.java 
Log Message:
Fix a couple of bugs found by Oliver Rau in Java libs.

Index: TorControlConnection0.java
===================================================================
RCS file: /home/or/cvsroot/control/java/net/freehaven/tor/control/TorControlConnection0.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- TorControlConnection0.java	20 Jul 2005 22:55:41 -0000	1.6
+++ TorControlConnection0.java	18 Sep 2005 22:33:12 -0000	1.7
@@ -287,7 +287,7 @@
                     }
                 }
                 if (e < 0)
-                    throw new Error("Unknown v0 code for event '"+s+"'");
+                    throw new TorControlError("Unknown v0 code for event '"+s+"'");
             }
             Bytes.setU16(ba, i, e);
         }
@@ -311,15 +311,15 @@
         if (signal.equals("HUP") || signal.equals("RELOAD"))
             sig = SIGNAL_HUP;
         else if (signal.equals("INT") || signal.equals("SHUTDOWN"))
-            sig = SIGNAL_HUP;
+            sig = SIGNAL_INT;
         else if (signal.equals("USR1") || signal.equals("DUMP"))
-            sig = SIGNAL_HUP;
+            sig = SIGNAL_USR1;
         else if (signal.equals("USR2") || signal.equals("DEBUG"))
-            sig = SIGNAL_HUP;
+            sig = SIGNAL_USR2;
         else if (signal.equals("TERM") || signal.equals("HALT"))
-            sig = SIGNAL_HUP;
+            sig = SIGNAL_TERM;
         else
-            throw new Error("Unrecognized value for signal()");
+            throw new TorControlError("Unrecognized value for signal()");
         byte[] ba = { (byte)sig };
         sendAndWaitForResponse(CMD_SIGNAL, ba);
     }