forked from I2P_Developers/i2p.i2p
I2CP: Write single byte directly
This commit is contained in:
@ -163,7 +163,7 @@ public class HostLookupMessage extends I2CPMessageImpl {
|
||||
_sessionId.writeBytes(os);
|
||||
DataHelper.writeLong(os, 4, _reqID);
|
||||
DataHelper.writeLong(os, 4, _timeout);
|
||||
DataHelper.writeLong(os, 1, _lookupType);
|
||||
os.write((byte) _lookupType);
|
||||
if (_lookupType == LOOKUP_HASH) {
|
||||
_hash.writeBytes(os);
|
||||
} else {
|
||||
|
@ -139,7 +139,7 @@ public class HostReplyMessage extends I2CPMessageImpl {
|
||||
try {
|
||||
_sessionId.writeBytes(os);
|
||||
DataHelper.writeLong(os, 4, _reqID);
|
||||
DataHelper.writeLong(os, 1, _code);
|
||||
os.write((byte) _code);
|
||||
if (_code == RESULT_SUCCESS)
|
||||
_dest.writeBytes(os);
|
||||
} catch (DataFormatException dfe) {
|
||||
|
@ -112,6 +112,8 @@ public class I2CPMessageHandler {
|
||||
return new HostReplyMessage();
|
||||
case CreateLeaseSet2Message.MESSAGE_TYPE:
|
||||
return new CreateLeaseSet2Message();
|
||||
case BlindingInfoMessage.MESSAGE_TYPE:
|
||||
return new BlindingInfoMessage();
|
||||
default:
|
||||
throw new I2CPMessageException("The type " + type + " is an unknown I2CP message");
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class RequestLeaseSetMessage extends I2CPMessageImpl {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(256);
|
||||
try {
|
||||
_sessionId.writeBytes(os);
|
||||
DataHelper.writeLong(os, 1, _endpoints.size());
|
||||
os.write((byte) _endpoints.size());
|
||||
for (int i = 0; i < _endpoints.size(); i++) {
|
||||
Hash router = getRouter(i);
|
||||
router.writeBytes(os);
|
||||
|
@ -112,7 +112,7 @@ public class RequestVariableLeaseSetMessage extends I2CPMessageImpl {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(256);
|
||||
try {
|
||||
_sessionId.writeBytes(os);
|
||||
DataHelper.writeLong(os, 1, _endpoints.size());
|
||||
os.write((byte) _endpoints.size());
|
||||
for (int i = 0; i < _endpoints.size(); i++) {
|
||||
_endpoints.get(i).writeBytes(os);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class SessionStatusMessage extends I2CPMessageImpl {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream(64);
|
||||
try {
|
||||
_sessionId.writeBytes(os);
|
||||
DataHelper.writeLong(os, 1, _status);
|
||||
os.write((byte) _status);
|
||||
} catch (DataFormatException dfe) {
|
||||
throw new I2CPMessageException("Error writing out the message data", dfe);
|
||||
}
|
||||
|
Reference in New Issue
Block a user