2005-07-20 jrandom

* Allow the user to specify an external port # for SSU even if the external
      host isn't specified (thanks duck!)
This commit is contained in:
jrandom
2005-07-20 19:24:47 +00:00
committed by zzz
parent 843d5b625a
commit 3563aa2e4d
3 changed files with 18 additions and 7 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;
}
}