I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit 7b6e6270 authored by zzz's avatar zzz
Browse files

SSU2: Data phase more fixes

Fix writing follow-on fragment block
Call messageFullyReceived() for I2NP block
Override messageFullyReceived() to avoid NPE
parent 9d9310a7
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,15 @@ public class PeerState2 extends PeerState implements SSU2Payload.PayloadCallback
// _wantACKSendSince = 0;
}
/**
* We received the message specified completely.
* @param bytes if less than or equal to zero, message is a duplicate.
*/
@Override
void messageFullyReceived(Long messageId, int bytes) {
// TODO
}
// SSU 1 unsupported things
@Override
......@@ -278,6 +287,7 @@ public class PeerState2 extends PeerState implements SSU2Payload.PayloadCallback
public void gotI2NP(I2NPMessage msg) {
// 9 byte header
int size = msg.getMessageSize() - 7;
messageFullyReceived(msg.getUniqueId(), size);
// complete message, skip IMF and MessageReceiver
_transport.messageReceived(msg, null, _remotePeer, 0, size);
}
......
......@@ -459,7 +459,7 @@ class SSU2Payload {
tgt[off++] = b;
DataHelper.toLong(tgt, off, 4, m.getMessageId());
off += 4;
return off + m.writeFragment(tgt, off, 0);
return off + m.writeFragment(tgt, off, f);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment