forked from I2P_Developers/i2p.i2p
log tweaks
This commit is contained in:
@@ -687,7 +687,7 @@ class Packet {
|
|||||||
protected StringBuilder formatAsString() {
|
protected StringBuilder formatAsString() {
|
||||||
StringBuilder buf = new StringBuilder(64);
|
StringBuilder buf = new StringBuilder(64);
|
||||||
buf.append(toId(_sendStreamId));
|
buf.append(toId(_sendStreamId));
|
||||||
//buf.append("<-->");
|
buf.append('/');
|
||||||
buf.append(toId(_receiveStreamId)).append(':');
|
buf.append(toId(_receiveStreamId)).append(':');
|
||||||
if (_sequenceNum != 0 || isFlagSet(FLAG_SYNCHRONIZE))
|
if (_sequenceNum != 0 || isFlagSet(FLAG_SYNCHRONIZE))
|
||||||
buf.append(" #").append(_sequenceNum);
|
buf.append(" #").append(_sequenceNum);
|
||||||
@@ -696,29 +696,27 @@ class Packet {
|
|||||||
// buf.append(" \t"); // so the tab lines up right
|
// buf.append(" \t"); // so the tab lines up right
|
||||||
//else
|
//else
|
||||||
// buf.append('\t');
|
// buf.append('\t');
|
||||||
buf.append(' ');
|
toFlagString(buf);
|
||||||
buf.append(toFlagString());
|
|
||||||
if (isFlagSet(FLAG_NO_ACK))
|
|
||||||
buf.append(" NO_ACK ");
|
|
||||||
else
|
|
||||||
buf.append(" ACK ").append(getAckThrough());
|
|
||||||
if (_nacks != null) {
|
|
||||||
buf.append(" NACK");
|
|
||||||
for (int i = 0; i < _nacks.length; i++) {
|
|
||||||
buf.append(" ").append(_nacks[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( (_payload != null) && (_payload.getValid() > 0) )
|
if ( (_payload != null) && (_payload.getValid() > 0) )
|
||||||
buf.append(" data: ").append(_payload.getValid());
|
buf.append(" data: ").append(_payload.getValid());
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final String toId(long id) {
|
static final String toId(long id) {
|
||||||
return Base64.encode(DataHelper.toLong(4, id));
|
return Base64.encode(DataHelper.toLong(4, id)).replace("==", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String toFlagString() {
|
private final void toFlagString(StringBuilder buf) {
|
||||||
StringBuilder buf = new StringBuilder(32);
|
if (isFlagSet(FLAG_NO_ACK))
|
||||||
|
buf.append(" NO_ACK");
|
||||||
|
else
|
||||||
|
buf.append(" ACK ").append(getAckThrough());
|
||||||
|
if (_nacks != null) {
|
||||||
|
buf.append(" NACK");
|
||||||
|
for (int i = 0; i < _nacks.length; i++) {
|
||||||
|
buf.append(' ').append(_nacks[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (isFlagSet(FLAG_CLOSE)) buf.append(" CLOSE");
|
if (isFlagSet(FLAG_CLOSE)) buf.append(" CLOSE");
|
||||||
if (isFlagSet(FLAG_DELAY_REQUESTED)) buf.append(" DELAY ").append(_optionDelay);
|
if (isFlagSet(FLAG_DELAY_REQUESTED)) buf.append(" DELAY ").append(_optionDelay);
|
||||||
if (isFlagSet(FLAG_ECHO)) buf.append(" ECHO");
|
if (isFlagSet(FLAG_ECHO)) buf.append(" ECHO");
|
||||||
@@ -729,7 +727,6 @@ class Packet {
|
|||||||
if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) buf.append(" SIG");
|
if (isFlagSet(FLAG_SIGNATURE_INCLUDED)) buf.append(" SIG");
|
||||||
if (isFlagSet(FLAG_SIGNATURE_REQUESTED)) buf.append(" SIGREQ");
|
if (isFlagSet(FLAG_SIGNATURE_REQUESTED)) buf.append(" SIGREQ");
|
||||||
if (isFlagSet(FLAG_SYNCHRONIZE)) buf.append(" SYN");
|
if (isFlagSet(FLAG_SYNCHRONIZE)) buf.append(" SYN");
|
||||||
return buf.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate a pcap/tcpdump-compatible format,
|
/** Generate a pcap/tcpdump-compatible format,
|
||||||
|
@@ -191,10 +191,6 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
|
|||||||
public StringBuilder formatAsString() {
|
public StringBuilder formatAsString() {
|
||||||
StringBuilder buf = super.formatAsString();
|
StringBuilder buf = super.formatAsString();
|
||||||
|
|
||||||
Connection con = _connection;
|
|
||||||
if (con != null)
|
|
||||||
buf.append(" rtt ").append(con.getOptions().getRTT());
|
|
||||||
|
|
||||||
//if ( (_tagsSent != null) && (!_tagsSent.isEmpty()) )
|
//if ( (_tagsSent != null) && (!_tagsSent.isEmpty()) )
|
||||||
// buf.append(" with tags");
|
// buf.append(" with tags");
|
||||||
final int nackCount = _nackCount.get();
|
final int nackCount = _nackCount.get();
|
||||||
@@ -213,6 +209,7 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
|
|||||||
FLAG_CLOSE |
|
FLAG_CLOSE |
|
||||||
FLAG_RESET)) {
|
FLAG_RESET)) {
|
||||||
|
|
||||||
|
Connection con = _connection;
|
||||||
if (con != null) {
|
if (con != null) {
|
||||||
buf.append(" from ");
|
buf.append(" from ");
|
||||||
Destination local = con.getSession().getMyDestination();
|
Destination local = con.getSession().getMyDestination();
|
||||||
|
Reference in New Issue
Block a user