logging and doc of a todo (wrt bestEffort)
This commit is contained in:
@ -87,6 +87,8 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
|||||||
*/
|
*/
|
||||||
public byte[] receiveMessage(int msgId) throws I2PSessionException {
|
public byte[] receiveMessage(int msgId) throws I2PSessionException {
|
||||||
byte compressed[] = super.receiveMessage(msgId);
|
byte compressed[] = super.receiveMessage(msgId);
|
||||||
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
|
_log.debug("receiving message " + msgId + " with " + compressed.length + " compressed bytes");
|
||||||
if (SHOULD_COMPRESS) {
|
if (SHOULD_COMPRESS) {
|
||||||
try {
|
try {
|
||||||
return DataHelper.decompress(compressed);
|
return DataHelper.decompress(compressed);
|
||||||
@ -224,21 +226,23 @@ class I2PSessionImpl2 extends I2PSessionImpl {
|
|||||||
boolean accepted = state.received(MessageStatusMessage.STATUS_SEND_ACCEPTED);
|
boolean accepted = state.received(MessageStatusMessage.STATUS_SEND_ACCEPTED);
|
||||||
|
|
||||||
if ((!accepted) || (state.getMessageId() == null)) {
|
if ((!accepted) || (state.getMessageId() == null)) {
|
||||||
if (_log.shouldLog(Log.ERROR))
|
if (_log.shouldLog(Log.CRIT))
|
||||||
_log.error(getPrefix() + "State with nonce " + state.getNonce()
|
_log.log(Log.CRIT, getPrefix() + "State with nonce " + state.getNonce()
|
||||||
+ " was not accepted? (no messageId!! found=" + found
|
+ " was not accepted? (no messageId!! found=" + found
|
||||||
+ " msgId=" + state.getMessageId() + ")",
|
+ " msgId=" + state.getMessageId() + ")");
|
||||||
new Exception("Race on accept/success status messages, or reconnected?"));
|
//if (true)
|
||||||
|
// throw new OutOfMemoryError("not really an OOM, but more of jr fucking shit up");
|
||||||
nackTags(state);
|
nackTags(state);
|
||||||
//if (_log.shouldLog(Log.CRIT))
|
|
||||||
// _log.log(Log.CRIT, "Disconnecting/reconnecting because we never were accepted!");
|
|
||||||
//disconnect();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug(getPrefix() + "After waitFor sending state " + state.getMessageId().getMessageId()
|
_log.debug(getPrefix() + "After waitFor sending state " + state.getMessageId().getMessageId()
|
||||||
+ " / " + state.getNonce() + " found = " + found);
|
+ " / " + state.getNonce() + " found = " + found);
|
||||||
|
|
||||||
|
// WARNING: this will always be false for mode=BestEffort, even though the message may go
|
||||||
|
// through, causing every datagram to be ElGamal encrypted!
|
||||||
|
// TODO: Fix this to include support for acks received after the sendMessage completes
|
||||||
if (found) {
|
if (found) {
|
||||||
if (_log.shouldLog(Log.INFO))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.info(getPrefix() + "Message sent after " + state.getElapsed() + "ms with "
|
_log.info(getPrefix() + "Message sent after " + state.getElapsed() + "ms with "
|
||||||
|
Reference in New Issue
Block a user