Author: nextgens
Date: 2006-08-20 13:08:28 +0000 (Sun, 20 Aug 2006)
New Revision: 10215
Modified:
trunk/freenet/src/freenet/config/SubConfig.java
trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java
Log:
The config framework ought to trim() the StringCallback, thanks to jbit for
noticing it
Modified: trunk/freenet/src/freenet/config/SubConfig.java
===================================================================
--- trunk/freenet/src/freenet/config/SubConfig.java 2006-08-20 12:47:50 UTC
(rev 10214)
+++ trunk/freenet/src/freenet/config/SubConfig.java 2006-08-20 13:08:28 UTC
(rev 10215)
@@ -118,7 +118,7 @@
synchronized(this) {
o = (StringOption) map.get(optionName);
}
- return o.getValue();
+ return o.getValue().trim();
}
public String[] getStringArr(String optionName) {
Modified: trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java 2006-08-20
12:47:50 UTC (rev 10214)
+++ trunk/freenet/src/freenet/io/comm/FreenetInetAddress.java 2006-08-20
13:08:28 UTC (rev 10215)
@@ -49,7 +49,10 @@
public FreenetInetAddress(String host, boolean allowUnknown) throws
UnknownHostException {
InetAddress addr = null;
- if((host != null) && host.startsWith("/")) host = host.substring(1);
+ if(host != null){
+ if(host.startsWith("/")) host = host.substring(1);
+ host = host.trim();
+ }
// if we were created with an explicit IP address, use it as such
// debugging log messages because AddressIdentifier doesn't appear to
handle all IPv6 literals correctly, such as "fe80::204:1234:dead:beef"
AddressIdentifier.AddressType addressType =
AddressIdentifier.getAddressType(host);