2005-09-15 jrandom
* Error handling for failed intro packets (thanks red.hand!) * More carefully verify intro addresses
This commit is contained in:
@ -1,4 +1,8 @@
|
|||||||
$Id: history.txt,v 1.248 2005/09/13 04:06:07 comwiz Exp $
|
$Id: history.txt,v 1.249 2005/09/13 18:02:44 jrandom Exp $
|
||||||
|
|
||||||
|
2005-09-15 jrandom
|
||||||
|
* Error handling for failed intro packets (thanks red.hand!)
|
||||||
|
* More carefully verify intro addresses
|
||||||
|
|
||||||
2005-09-13 jrandom
|
2005-09-13 jrandom
|
||||||
* More careful error handling with introductions (thanks dust!)
|
* More careful error handling with introductions (thanks dust!)
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
public class RouterVersion {
|
||||||
public final static String ID = "$Revision: 1.234 $ $Date: 2005/09/12 22:32:30 $";
|
public final static String ID = "$Revision: 1.235 $ $Date: 2005/09/13 18:02:40 $";
|
||||||
public final static String VERSION = "0.6.0.5";
|
public final static String VERSION = "0.6.0.5";
|
||||||
public final static long BUILD = 9;
|
public final static long BUILD = 10;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
@ -114,6 +114,40 @@ public class UDPAddress {
|
|||||||
_introKeys[i] = ikey;
|
_introKeys[i] = ikey;
|
||||||
_introTags[i] = tag;
|
_introTags[i] = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int numOK = 0;
|
||||||
|
if (_introHosts != null) {
|
||||||
|
for (int i = 0; i < _introHosts.length; i++) {
|
||||||
|
if ( (_introKeys[i] != null) &&
|
||||||
|
(_introPorts[i] > 0) &&
|
||||||
|
(_introTags[i] > 0) &&
|
||||||
|
(_introHosts[i] != null) )
|
||||||
|
numOK++;
|
||||||
|
}
|
||||||
|
if (numOK != _introHosts.length) {
|
||||||
|
String hosts[] = new String[numOK];
|
||||||
|
int ports[] = new int[numOK];
|
||||||
|
long tags[] = new long[numOK];
|
||||||
|
byte keys[][] = new byte[numOK][];
|
||||||
|
int cur = 0;
|
||||||
|
for (int i = 0; i < _introHosts.length; i++) {
|
||||||
|
if ( (_introKeys[i] != null) &&
|
||||||
|
(_introPorts[i] > 0) &&
|
||||||
|
(_introTags[i] > 0) &&
|
||||||
|
(_introHosts[i] != null) ) {
|
||||||
|
hosts[cur] = _introHosts[i];
|
||||||
|
ports[cur] = _introPorts[i];
|
||||||
|
tags[cur] = _introTags[i];
|
||||||
|
keys[cur] = _introKeys[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_introKeys = keys;
|
||||||
|
_introTags = tags;
|
||||||
|
_introPorts = ports;
|
||||||
|
_introHosts = hosts;
|
||||||
|
_introAddresses = new InetAddress[numOK];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getHost() { return _host; }
|
public String getHost() { return _host; }
|
||||||
|
@ -107,6 +107,7 @@ public class UDPSender {
|
|||||||
* @return number of packets in the queue
|
* @return number of packets in the queue
|
||||||
*/
|
*/
|
||||||
public int add(UDPPacket packet) {
|
public int add(UDPPacket packet) {
|
||||||
|
if (packet == null) return 0;
|
||||||
int size = 0;
|
int size = 0;
|
||||||
long lifetime = -1;
|
long lifetime = -1;
|
||||||
synchronized (_outboundQueue) {
|
synchronized (_outboundQueue) {
|
||||||
|
Reference in New Issue
Block a user