I2CP: Fix external I2CP SendMessageExpires, broken in previous cleanup

This commit is contained in:
zzz
2015-05-04 12:36:03 +00:00
parent 5c2b5075f9
commit 94bba8d11f

View File

@ -84,8 +84,8 @@ public class SendMessageMessage extends I2CPMessageImpl {
*/
@Override
public void readMessage(InputStream in, int length, int type) throws I2CPMessageException, IOException {
if (type != MESSAGE_TYPE)
throw new I2CPMessageException("Invalid message type (found: " + type + " supported: " + MESSAGE_TYPE
if (type != getType())
throw new I2CPMessageException("Invalid message type (found: " + type + " supported: " + getType()
+ " class: " + getClass().getName() + ")");
if (length < 0) throw new IOException("Negative payload size");
@ -129,7 +129,7 @@ public class SendMessageMessage extends I2CPMessageImpl {
try {
DataHelper.writeLong(out, 4, len);
DataHelper.writeLong(out, 1, MESSAGE_TYPE);
DataHelper.writeLong(out, 1, getType());
_sessionId.writeBytes(out);
_destination.writeBytes(out);
_payload.writeBytes(out);