Changeset 1451dc6
- Timestamp:
- Nov 8, 2015 8:43:42 PM (5 years ago)
- Branches:
- master
- Children:
- c1afbd3
- Parents:
- 1aed266
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/streaming/java/src/net/i2p/client/streaming/impl/Packet.java
r1aed266 r1451dc6 586 586 setAckThrough(DataHelper.fromLong(buffer, cur, 4)); 587 587 cur += 4; 588 int numNacks = (int)DataHelper.fromLong(buffer, cur, 1);588 int numNacks = buffer[cur] & 0xff; 589 589 cur++; 590 590 if (length < 22 + numNacks*4) … … 600 600 setNacks(null); 601 601 } 602 setResendDelay( (int)DataHelper.fromLong(buffer, cur, 1));602 setResendDelay(buffer[cur] & 0xff); 603 603 cur++; 604 604 setFlags((int)DataHelper.fromLong(buffer, cur, 2)); -
core/java/src/net/i2p/data/Certificate.java
r1aed266 r1451dc6 216 216 217 217 int cur = offset; 218 _type = (int)DataHelper.fromLong(source, cur, 1);218 _type = source[cur] & 0xff; 219 219 cur++; 220 220 int length = (int)DataHelper.fromLong(source, cur, 2); -
router/java/src/net/i2p/data/i2np/DatabaseSearchReplyMessage.java
r1aed266 r1451dc6 69 69 //_key = new Hash(keyData); 70 70 71 int num = (int)DataHelper.fromLong(data, curIndex, 1);71 int num = data[curIndex] & 0xff; 72 72 curIndex++; 73 73 -
router/java/src/net/i2p/data/i2np/DeliveryInstructions.java
r1aed266 r1451dc6 210 210 public int readBytes(byte data[], int offset) throws DataFormatException { 211 211 int cur = offset; 212 long flags = DataHelper.fromLong(data, cur, 1);212 int flags = data[cur] & 0xff; 213 213 cur++; 214 214 //if (_log.shouldLog(Log.DEBUG)) -
router/java/src/net/i2p/data/i2np/FastI2NPMessageImpl.java
r1aed266 r1451dc6 86 86 int cur = offset; 87 87 if (type < 0) { 88 type = (int)DataHelper.fromLong(data, cur, 1);88 type = data[cur] & 0xff; 89 89 cur++; 90 90 } -
router/java/src/net/i2p/data/i2np/I2NPMessageHandler.java
r1aed266 r1451dc6 110 110 int cur = offset; 111 111 // we will assume that maxLen is >= 1 here. It's checked to be >= 16 in readBytes() 112 int type = (int)DataHelper.fromLong(data, cur, 1);112 int type = data[cur] & 0xff; 113 113 cur++; 114 114 _lastReadBegin = System.currentTimeMillis(); -
router/java/src/net/i2p/data/i2np/I2NPMessageImpl.java
r1aed266 r1451dc6 198 198 int cur = offset; 199 199 if (type < 0) { 200 type = (int)DataHelper.fromLong(data, cur, 1);200 type = data[cur] & 0xff; 201 201 cur++; 202 202 } … … 414 414 public static I2NPMessage fromRawByteArray(I2PAppContext ctx, byte buffer[], int offset, 415 415 int len, I2NPMessageHandler handler) throws I2NPMessageException { 416 int type = (int)DataHelper.fromLong(buffer, offset, 1);416 int type = buffer[offset] & 0xff; 417 417 offset++; 418 418 I2NPMessage msg = createMessage(ctx, type); -
router/java/src/net/i2p/data/i2np/VariableTunnelBuildMessage.java
r1aed266 r1451dc6 30 30 public void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageException { 31 31 // message type will be checked in super() 32 int r = (int)DataHelper.fromLong(data, offset, 1);32 int r = data[offset] & 0xff; 33 33 if (r <= 0 || r > MAX_RECORD_COUNT) 34 34 throw new I2NPMessageException("Bad record count " + r); -
router/java/src/net/i2p/data/i2np/VariableTunnelBuildReplyMessage.java
r1aed266 r1451dc6 32 32 public void readMessage(byte[] data, int offset, int dataSize, int type) throws I2NPMessageException { 33 33 // message type will be checked in super() 34 int r = (int)DataHelper.fromLong(data, offset, 1);34 int r = data[offset] & 0xff; 35 35 if (r <= 0 || r > MAX_RECORD_COUNT) 36 36 throw new I2NPMessageException("Bad record count " + r); -
router/java/src/net/i2p/router/message/GarlicMessageParser.java
r1aed266 r1451dc6 76 76 int offset = 0; 77 77 78 int numCloves = (int)DataHelper.fromLong(data, offset, 1);78 int numCloves = data[offset] & 0xff; 79 79 offset++; 80 80 if (_log.shouldLog(Log.DEBUG)) -
router/java/src/net/i2p/router/tunnel/BuildReplyHandler.java
r1aed266 r1451dc6 121 121 } else { 122 122 SimpleByteCache.release(h); 123 int rv = (int)DataHelper.fromLong(data, TunnelBuildReplyMessage.RECORD_SIZE - 1, 1);123 int rv = data[TunnelBuildReplyMessage.RECORD_SIZE - 1] & 0xff; 124 124 if (log.shouldLog(Log.DEBUG)) 125 125 log.debug(reply.getUniqueId() + ": Verified: " + rv + " for record " + recordNum + "/" + hop); -
router/java/src/net/i2p/router/tunnel/FragmentHandler.java
r1aed266 r1451dc6 341 341 } 342 342 if (extended) { 343 int extendedSize = (int)DataHelper.fromLong(preprocessed, offset, 1);343 int extendedSize = preprocessed[offset] & 0xff; 344 344 offset++; 345 345 offset += extendedSize; // we don't interpret these yet, but skip them for now
Note: See TracChangeset
for help on using the changeset viewer.