[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r10206: Make java controller code handle config optiions that are se (torctl/trunk/java/net/freehaven/tor/control)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r10206: Make java controller code handle config optiions that are se (torctl/trunk/java/net/freehaven/tor/control)
- From: nickm@xxxxxxxx
- Date: Fri, 18 May 2007 16:53:50 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Fri, 18 May 2007 16:53:57 -0400
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: nickm
Date: 2007-05-18 16:53:49 -0400 (Fri, 18 May 2007)
New Revision: 10206
Modified:
torctl/trunk/java/net/freehaven/tor/control/ConfigEntry.java
torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java
Log:
Make java controller code handle config optiions that are set to their defaults. Fixes bug 408.
Modified: torctl/trunk/java/net/freehaven/tor/control/ConfigEntry.java
===================================================================
--- torctl/trunk/java/net/freehaven/tor/control/ConfigEntry.java 2007-05-18 13:53:13 UTC (rev 10205)
+++ torctl/trunk/java/net/freehaven/tor/control/ConfigEntry.java 2007-05-18 20:53:49 UTC (rev 10206)
@@ -8,7 +8,14 @@
public ConfigEntry(String k, String v) {
key = k;
value = v;
+ is_default = false;
}
+ public ConfigEntry(String k) {
+ key = k;
+ value = "";
+ is_default = true;
+ }
public final String key;
public final String value;
+ public final boolean is_default;
}
Modified: torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java
===================================================================
--- torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java 2007-05-18 13:53:13 UTC (rev 10205)
+++ torctl/trunk/java/net/freehaven/tor/control/TorControlConnection1.java 2007-05-18 20:53:49 UTC (rev 10206)
@@ -322,8 +322,11 @@
for (Iterator it = lst.iterator(); it.hasNext(); ) {
String kv = ((ReplyLine) it.next()).msg;
int idx = kv.indexOf('=');
- result.add(new ConfigEntry(kv.substring(0, idx),
- kv.substring(idx+1)));
+ if (idx >= 0)
+ result.add(new ConfigEntry(kv.substring(0, idx),
+ kv.substring(idx+1)));
+ else
+ result.add(new ConfigEntry(kv));
}
return result;
}