forked from I2P_Developers/i2p.i2p
* UDPPacketReader: Adjust logging
This commit is contained in:
@@ -564,15 +564,15 @@ public class UDPPacketReader {
|
|||||||
public class RelayRequestReader {
|
public class RelayRequestReader {
|
||||||
public long readTag() {
|
public long readTag() {
|
||||||
long rv = DataHelper.fromLong(_message, readBodyOffset(), 4);
|
long rv = DataHelper.fromLong(_message, readBodyOffset(), 4);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read alice tag: " + rv);
|
_log.debug("read alice tag: " + rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
public int readIPSize() {
|
public int readIPSize() {
|
||||||
int offset = readBodyOffset() + 4;
|
int offset = readBodyOffset() + 4;
|
||||||
int rv = (int)DataHelper.fromLong(_message, offset, 1);
|
int rv = (int)DataHelper.fromLong(_message, offset, 1);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read alice ip size: " + rv);
|
_log.debug("read alice ip size: " + rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -582,16 +582,16 @@ public class UDPPacketReader {
|
|||||||
int size = (int)DataHelper.fromLong(_message, offset, 1);
|
int size = (int)DataHelper.fromLong(_message, offset, 1);
|
||||||
offset++;
|
offset++;
|
||||||
System.arraycopy(_message, offset, target, targetOffset, size);
|
System.arraycopy(_message, offset, target, targetOffset, size);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read alice ip: " + Base64.encode(target, targetOffset, size));
|
_log.debug("read alice ip: " + Base64.encode(target, targetOffset, size));
|
||||||
}
|
}
|
||||||
public int readPort() {
|
public int readPort() {
|
||||||
int offset = readBodyOffset() + 4;
|
int offset = readBodyOffset() + 4;
|
||||||
offset += DataHelper.fromLong(_message, offset, 1);
|
offset += DataHelper.fromLong(_message, offset, 1);
|
||||||
offset++;
|
offset++;
|
||||||
int rv = (int)DataHelper.fromLong(_message, offset, 2);
|
int rv = (int)DataHelper.fromLong(_message, offset, 2);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read alice port: " + rv);
|
_log.debug("read alice port: " + rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
public int readChallengeSize() {
|
public int readChallengeSize() {
|
||||||
@@ -600,8 +600,8 @@ public class UDPPacketReader {
|
|||||||
offset++;
|
offset++;
|
||||||
offset += 2;
|
offset += 2;
|
||||||
int rv = (int)DataHelper.fromLong(_message, offset, 1);
|
int rv = (int)DataHelper.fromLong(_message, offset, 1);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read challenge size: " + rv);
|
_log.debug("read challenge size: " + rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
public void readChallengeSize(byte target[], int targetOffset) {
|
public void readChallengeSize(byte target[], int targetOffset) {
|
||||||
@@ -612,8 +612,8 @@ public class UDPPacketReader {
|
|||||||
int sz = (int)DataHelper.fromLong(_message, offset, 1);
|
int sz = (int)DataHelper.fromLong(_message, offset, 1);
|
||||||
offset++;
|
offset++;
|
||||||
System.arraycopy(_message, offset, target, targetOffset, sz);
|
System.arraycopy(_message, offset, target, targetOffset, sz);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read challenge data: " + Base64.encode(target));
|
_log.debug("read challenge data: " + Base64.encode(target));
|
||||||
}
|
}
|
||||||
public void readAliceIntroKey(byte target[], int targetOffset) {
|
public void readAliceIntroKey(byte target[], int targetOffset) {
|
||||||
int offset = readBodyOffset() + 4;
|
int offset = readBodyOffset() + 4;
|
||||||
@@ -624,8 +624,8 @@ public class UDPPacketReader {
|
|||||||
offset++;
|
offset++;
|
||||||
offset += sz;
|
offset += sz;
|
||||||
System.arraycopy(_message, offset, target, targetOffset, SessionKey.KEYSIZE_BYTES);
|
System.arraycopy(_message, offset, target, targetOffset, SessionKey.KEYSIZE_BYTES);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read alice intro key: " + Base64.encode(target, targetOffset, SessionKey.KEYSIZE_BYTES)
|
_log.debug("read alice intro key: " + Base64.encode(target, targetOffset, SessionKey.KEYSIZE_BYTES)
|
||||||
+ " packet size: " + _payloadLength + " off: " + offset + " data: " + Base64.encode(_message));
|
+ " packet size: " + _payloadLength + " off: " + offset + " data: " + Base64.encode(_message));
|
||||||
}
|
}
|
||||||
public long readNonce() {
|
public long readNonce() {
|
||||||
@@ -638,8 +638,8 @@ public class UDPPacketReader {
|
|||||||
offset += sz;
|
offset += sz;
|
||||||
offset += SessionKey.KEYSIZE_BYTES;
|
offset += SessionKey.KEYSIZE_BYTES;
|
||||||
long rv = DataHelper.fromLong(_message, offset, 4);
|
long rv = DataHelper.fromLong(_message, offset, 4);
|
||||||
if (_log.shouldLog(Log.WARN))
|
if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.warn("read request nonce: " + rv);
|
_log.debug("read request nonce: " + rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user