From 3563aa2e4da84b117b34f99d40b8772126e0ebad Mon Sep 17 00:00:00 2001 From: jrandom Date: Wed, 20 Jul 2005 19:24:47 +0000 Subject: [PATCH] 2005-07-20 jrandom * Allow the user to specify an external port # for SSU even if the external host isn't specified (thanks duck!) --- history.txt | 6 +++++- router/java/src/net/i2p/router/RouterVersion.java | 4 ++-- .../i2p/router/transport/udp/UDPTransport.java | 15 +++++++++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/history.txt b/history.txt index 75f968e99..4c74b2cc8 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,8 @@ -$Id: history.txt,v 1.213 2005/07/16 07:52:36 cervantes Exp $ +$Id: history.txt,v 1.214 2005/07/19 16:00:25 jrandom Exp $ + +2005-07-20 jrandom + * Allow the user to specify an external port # for SSU even if the external + host isn't specified (thanks duck!) 2005-07-19 jrandom * Further preparation for removing I2CP crypto diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 5c5a8bc85..4fcfe38be 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.204 $ $Date: 2005/07/16 07:52:36 $"; + public final static String ID = "$Revision: 1.205 $ $Date: 2005/07/19 16:00:26 $"; public final static String VERSION = "0.5.0.7"; - public final static long BUILD = 16; + public final static long BUILD = 17; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index afceef342..91242a213 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -483,16 +483,23 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority } void rebuildExternalAddress() { + // if the external port is specified, we want to use that to bind to even + // if we don't know the external host. + String port = _context.getProperty(PROP_EXTERNAL_PORT); + if (port != null) { + try { + _externalListenPort = Integer.parseInt(port); + } catch (NumberFormatException nfe) { + _externalListenPort = -1; + } + } + if (explicitAddressSpecified()) { try { String host = _context.getProperty(PROP_EXTERNAL_HOST); - String port = _context.getProperty(PROP_EXTERNAL_PORT); _externalListenHost = InetAddress.getByName(host); - _externalListenPort = Integer.parseInt(port); } catch (UnknownHostException uhe) { _externalListenHost = null; - } catch (NumberFormatException nfe) { - _externalListenPort = -1; } }