- Timestamp:
- 2014-12-19T01:13:22+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
r7800 r7826 38 38 static final int protocolMinorVersion = 7; 39 39 40 private static final String LOCALHOST = " localhost";40 private static final String LOCALHOST = "127.0.0.1"; 41 41 42 42 /** … … 84 84 */ 85 85 public static InetAddress getInetAddress() throws UnknownHostException { 86 String hostname = Main.pref.get("remote.control.host", LOCALHOST); 87 InetAddress result = InetAddress.getByName(hostname); 88 // Sometimes localhost resolution does not work as expected, see #10833 89 if (LOCALHOST.equalsIgnoreCase(hostname) && !LOCALHOST.equalsIgnoreCase(result.getHostName())) { 90 InetAddress localhostAddr = InetAddress.getLocalHost(); 91 // Use this result if it's better. Not sure if it's a Java bug or not 92 if (LOCALHOST.equalsIgnoreCase(localhostAddr.getHostName())) { 93 result = localhostAddr; 94 } 95 } 96 return result; 86 return InetAddress.getByName(Main.pref.get("remote.control.host", LOCALHOST)); 97 87 } 98 88 }
Note:
See TracChangeset
for help on using the changeset viewer.