mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-167 added support for larger entry sizes
This commit is contained in:
@@ -94,17 +94,17 @@ class UdpReplicator extends UdpChannelReplicator implements Replica.Modification
|
||||
|
||||
final int bytesRead = in.position();
|
||||
|
||||
if (bytesRead < SIZE_OF_SHORT + SIZE_OF_SHORT)
|
||||
if (bytesRead < SIZE_OF_SIZE + SIZE_OF_SIZE)
|
||||
return;
|
||||
|
||||
out.limit(in.position());
|
||||
|
||||
final short invertedSize = out.readShort();
|
||||
final int size = out.readUnsignedShort();
|
||||
final int invertedSize = out.readInt();
|
||||
final int size = out.readInt();
|
||||
|
||||
// check the the first 4 bytes are the inverted len followed by the len
|
||||
// we do this to check that this is a valid start of entry, otherwise we throw it away
|
||||
if (((short) ~size) != invertedSize)
|
||||
if ( ~size != invertedSize)
|
||||
return;
|
||||
|
||||
if (out.remaining() != size)
|
||||
@@ -157,7 +157,7 @@ class UdpReplicator extends UdpChannelReplicator implements Replica.Modification
|
||||
|
||||
out.clear();
|
||||
in.clear();
|
||||
in.skip(SIZE_OF_SHORT);
|
||||
in.skip(SIZE_OF_SIZE);
|
||||
|
||||
final boolean wasDataRead = modificationIterator.nextEntry(entryCallback, 0);
|
||||
|
||||
@@ -167,7 +167,7 @@ class UdpReplicator extends UdpChannelReplicator implements Replica.Modification
|
||||
}
|
||||
|
||||
// we'll write the size inverted at the start
|
||||
in.writeShort(0, ~(in.readUnsignedShort(SIZE_OF_SHORT)));
|
||||
in.writeShort(0, ~(in.readUnsignedShort(SIZE_OF_SIZE)));
|
||||
out.limit((int) in.position());
|
||||
|
||||
return socketChannel.write(out);
|
||||
|
||||
Reference in New Issue
Block a user