forked from I2P_Developers/i2p.i2p
2006-02-20 jrandom
* Major SSU and router tuning to reduce contention, memory usage, and GC
churn. There are still issues to be worked out, but this should be a
substantial improvement.
* Modified the optional netDb harvester task to support choosing whether
to use (non-anonymous) direct connections or (anonymous) exploratory
tunnels to do the harvesting. Harvesting itself is enabled via the
advanced config "netDb.shouldHarvest=true" (default is false) and the
connection type can be chosen via "netDb.harvestDirectly=false" (default
is false).
This commit is contained in:
@@ -30,10 +30,19 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
_data = null;
|
||||
}
|
||||
|
||||
public byte[] getData() { return _data; }
|
||||
public void setData(byte data[]) { _data = data; }
|
||||
public byte[] getData() {
|
||||
verifyUnwritten();
|
||||
return _data;
|
||||
}
|
||||
public void setData(byte[] data) {
|
||||
verifyUnwritten();
|
||||
_data = data;
|
||||
}
|
||||
|
||||
public int getSize() { return _data.length; }
|
||||
public int getSize() {
|
||||
verifyUnwritten();
|
||||
return _data.length;
|
||||
}
|
||||
|
||||
public void readMessage(byte data[], int offset, int dataSize, int type) throws I2NPMessageException, IOException {
|
||||
if (type != MESSAGE_TYPE) throw new I2NPMessageException("Message type is incorrect for this message");
|
||||
@@ -55,6 +64,7 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
}
|
||||
/** write the message body to the output array, starting at the given index */
|
||||
protected int writeMessageBody(byte out[], int curIndex) {
|
||||
verifyUnwritten();
|
||||
if (_data == null) {
|
||||
out[curIndex++] = 0x0;
|
||||
out[curIndex++] = 0x0;
|
||||
@@ -70,6 +80,11 @@ public class DataMessage extends I2NPMessageImpl {
|
||||
return curIndex;
|
||||
}
|
||||
|
||||
protected void written() {
|
||||
super.written();
|
||||
_data = null;
|
||||
}
|
||||
|
||||
public int getType() { return MESSAGE_TYPE; }
|
||||
|
||||
public int hashCode() {
|
||||
|
||||
Reference in New Issue
Block a user