Commit 42299356 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Changed encoding format of internal DNS. JM-711

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3965 b35dd754-fafc-0310-a699-88a17e54d16e
parent 94e4d89f
...@@ -144,16 +144,16 @@ public class DNSUtil { ...@@ -144,16 +144,16 @@ public class DNSUtil {
if (sb.length() > 0) { if (sb.length() > 0) {
sb.append(","); sb.append(",");
} }
sb.append(key).append(","); sb.append("{").append(key).append(",");
sb.append(internalDNS.get(key).getHost()).append(","); sb.append(internalDNS.get(key).getHost()).append(":");
sb.append(internalDNS.get(key).getPort()); sb.append(internalDNS.get(key).getPort()).append("}");
} }
return sb.toString(); return sb.toString();
} }
private static Map<String, HostAddress> decode(String encodedValue) { private static Map<String, HostAddress> decode(String encodedValue) {
Map<String, HostAddress> answer = new HashMap<String, HostAddress>(); Map<String, HostAddress> answer = new HashMap<String, HostAddress>();
StringTokenizer st = new StringTokenizer(encodedValue, ","); StringTokenizer st = new StringTokenizer(encodedValue, "{},:");
while (st.hasMoreElements()) { while (st.hasMoreElements()) {
String key = st.nextToken(); String key = st.nextToken();
answer.put(key, new HostAddress(st.nextToken(), Integer.parseInt(st.nextToken()))); answer.put(key, new HostAddress(st.nextToken(), Integer.parseInt(st.nextToken())));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment