forked from I2P_Developers/i2p.i2p
I2NP: Remove unused I2NPMessageHandler methods
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2019-10-06 zzz
|
||||||
|
* I2NP: Remove unused I2NPMessageHandler methods
|
||||||
|
|
||||||
|
2019-10-03 zzz
|
||||||
|
* i2psnark: Start with minimum tunnel count (ticket #2623)
|
||||||
|
|
||||||
|
2019-10-03 idk
|
||||||
|
* Console: Wizard updates (ticket #2415)
|
||||||
|
|
||||||
2019-10-01 zzz
|
2019-10-01 zzz
|
||||||
* Console: Remove i2pwiki.i2p (ticket #2626)
|
* Console: Remove i2pwiki.i2p (ticket #2626)
|
||||||
* PortMapper: Fix URL generation for IPv6 hosts
|
* PortMapper: Fix URL generation for IPv6 hosts
|
||||||
|
@ -22,16 +22,11 @@ import net.i2p.util.Log;
|
|||||||
public class I2NPMessageHandler {
|
public class I2NPMessageHandler {
|
||||||
private final Log _log;
|
private final Log _log;
|
||||||
private final I2PAppContext _context;
|
private final I2PAppContext _context;
|
||||||
private long _lastReadBegin;
|
|
||||||
private long _lastReadEnd;
|
|
||||||
private int _lastSize;
|
|
||||||
private byte _messageBuffer[];
|
|
||||||
private I2NPMessage _lastRead;
|
private I2NPMessage _lastRead;
|
||||||
|
|
||||||
public I2NPMessageHandler(I2PAppContext context) {
|
public I2NPMessageHandler(I2PAppContext context) {
|
||||||
_context = context;
|
_context = context;
|
||||||
_log = context.logManager().getLog(I2NPMessageHandler.class);
|
_log = context.logManager().getLog(I2NPMessageHandler.class);
|
||||||
_lastSize = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** clear the last message read from a byte array with an offset */
|
/** clear the last message read from a byte array with an offset */
|
||||||
@ -74,11 +69,10 @@ public class I2NPMessageHandler {
|
|||||||
// we will assume that maxLen is >= 1 here. It's checked to be >= 16 in readBytes()
|
// we will assume that maxLen is >= 1 here. It's checked to be >= 16 in readBytes()
|
||||||
int type = data[cur] & 0xff;
|
int type = data[cur] & 0xff;
|
||||||
cur++;
|
cur++;
|
||||||
_lastReadBegin = System.currentTimeMillis();
|
|
||||||
I2NPMessage msg = I2NPMessageImpl.createMessage(_context, type);
|
I2NPMessage msg = I2NPMessageImpl.createMessage(_context, type);
|
||||||
try {
|
try {
|
||||||
_lastSize = msg.readBytes(data, type, cur, maxLen - 1);
|
int lastSize = msg.readBytes(data, type, cur, maxLen - 1);
|
||||||
cur += _lastSize;
|
cur += lastSize;
|
||||||
} catch (I2NPMessageException ime) {
|
} catch (I2NPMessageException ime) {
|
||||||
throw ime;
|
throw ime;
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
@ -86,12 +80,7 @@ public class I2NPMessageHandler {
|
|||||||
_log.warn("Error reading the stream", e);
|
_log.warn("Error reading the stream", e);
|
||||||
throw new I2NPMessageException("Unknown error reading the " + msg.getClass().getSimpleName(), e);
|
throw new I2NPMessageException("Unknown error reading the " + msg.getClass().getSimpleName(), e);
|
||||||
}
|
}
|
||||||
_lastReadEnd = System.currentTimeMillis();
|
|
||||||
_lastRead = msg;
|
_lastRead = msg;
|
||||||
return cur - offset;
|
return cur - offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getLastReadTime() { return _lastReadEnd - _lastReadBegin; }
|
|
||||||
public int getLastSize() { return _lastSize; }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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 = 9;
|
public final static long BUILD = 10;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user