- Try again to fix console on Windows w/o IPv6 (ticket # 621)

This commit is contained in:
zzz
2012-03-26 14:07:38 +00:00
parent 764a7f2e13
commit 11ff89fef2
3 changed files with 26 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.InetSocketAddress;
import java.net.ServerSocket; import java.net.ServerSocket;
import java.security.KeyStore; import java.security.KeyStore;
import java.util.HashMap; import java.util.HashMap;
@ -311,13 +312,20 @@ public class RouterConsoleRunner {
// Test before we add the connector, because Jetty 6 won't start if any of the // Test before we add the connector, because Jetty 6 won't start if any of the
// connectors are bad // connectors are bad
InetAddress test = InetAddress.getByName(host); InetAddress test = InetAddress.getByName(host);
ServerSocket testSock = null;
if ((!hasIPV6) && (!(test instanceof Inet4Address))) if ((!hasIPV6) && (!(test instanceof Inet4Address)))
throw new IOException("IPv6 addresses unsupported"); throw new IOException("IPv6 addresses unsupported");
if ((!hasIPV4) && (test instanceof Inet4Address)) if ((!hasIPV4) && (test instanceof Inet4Address))
throw new IOException("IPv4 addresses unsupported"); throw new IOException("IPv4 addresses unsupported");
ServerSocket testSock = null;
try { try {
testSock = new ServerSocket(0, 0, test); // On Windows, this was passing and Jetty was still failing,
// possibly due to %scope_id ???
// https://issues.apache.org/jira/browse/ZOOKEEPER-667
//testSock = new ServerSocket(0, 0, test);
// so do exactly what Jetty does in SelectChannelConnector.open()
testSock = new ServerSocket();
InetSocketAddress isa = new InetSocketAddress(host, 0);
testSock.bind(isa);
} finally { } finally {
if (testSock != null) try { testSock.close(); } catch (IOException ioe) {} if (testSock != null) try { testSock.close(); } catch (IOException ioe) {}
} }
@ -369,7 +377,11 @@ public class RouterConsoleRunner {
throw new IOException("IPv4 addresses unsupported"); throw new IOException("IPv4 addresses unsupported");
ServerSocket testSock = null; ServerSocket testSock = null;
try { try {
testSock = new ServerSocket(0, 0, test); // see comments above
//testSock = new ServerSocket(0, 0, test);
testSock = new ServerSocket();
InetSocketAddress isa = new InetSocketAddress(host, 0);
testSock.bind(isa);
} finally { } finally {
if (testSock != null) try { testSock.close(); } catch (IOException ioe) {} if (testSock != null) try { testSock.close(); } catch (IOException ioe) {}
} }

View File

@ -1,3 +1,13 @@
2012-03-26 zzz
* Code cleanups:
- Remove unused imports
- Remove unused local variables
- Remove unused private fields
- Remove unnecessary casts
* Console:
- Try again to fix console on Windows w/o IPv6 (ticket # 621)
- Move oldconsole rendering from Router to OldConsoleHelper
2012-03-24 zzz 2012-03-24 zzz
* GarlicConfig: Remove more unused methods * GarlicConfig: Remove more unused methods
* i2psnark: * i2psnark:

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 21; public final static long BUILD = 22;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";