forked from I2P_Developers/i2p.i2p
log tweaks
This commit is contained in:
@@ -687,7 +687,7 @@ class Packet {
|
||||
protected StringBuilder formatAsString() {
|
||||
StringBuilder buf = new StringBuilder(64);
|
||||
buf.append(toId(_sendStreamId));
|
||||
//buf.append("<-->");
|
||||
buf.append('/');
|
||||
buf.append(toId(_receiveStreamId)).append(':');
|
||||
if (_sequenceNum != 0 || isFlagSet(FLAG_SYNCHRONIZE))
|
||||
buf.append(" #").append(_sequenceNum);
|
||||
@@ -696,29 +696,27 @@ class Packet {
|
||||
// buf.append(" \t"); // so the tab lines up right
|
||||
//else
|
||||
// buf.append('\t');
|
||||
buf.append(' ');
|
||||
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]);
|
||||
}
|
||||
}
|
||||
toFlagString(buf);
|
||||
if ( (_payload != null) && (_payload.getValid() > 0) )
|
||||
buf.append(" data: ").append(_payload.getValid());
|
||||
return buf;
|
||||
}
|
||||
|
||||
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() {
|
||||
StringBuilder buf = new StringBuilder(32);
|
||||
private final void toFlagString(StringBuilder buf) {
|
||||
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_DELAY_REQUESTED)) buf.append(" DELAY ").append(_optionDelay);
|
||||
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_REQUESTED)) buf.append(" SIGREQ");
|
||||
if (isFlagSet(FLAG_SYNCHRONIZE)) buf.append(" SYN");
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/** Generate a pcap/tcpdump-compatible format,
|
||||
|
@@ -191,10 +191,6 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
|
||||
public StringBuilder formatAsString() {
|
||||
StringBuilder buf = super.formatAsString();
|
||||
|
||||
Connection con = _connection;
|
||||
if (con != null)
|
||||
buf.append(" rtt ").append(con.getOptions().getRTT());
|
||||
|
||||
//if ( (_tagsSent != null) && (!_tagsSent.isEmpty()) )
|
||||
// buf.append(" with tags");
|
||||
final int nackCount = _nackCount.get();
|
||||
@@ -213,6 +209,7 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
|
||||
FLAG_CLOSE |
|
||||
FLAG_RESET)) {
|
||||
|
||||
Connection con = _connection;
|
||||
if (con != null) {
|
||||
buf.append(" from ");
|
||||
Destination local = con.getSession().getMyDestination();
|
||||
|
Reference in New Issue
Block a user