mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
HCOLL-167 improved the buffer overflow support
This commit is contained in:
@@ -35,7 +35,7 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
|
||||
private final ByteBuffer outBuffer = allocateDirect(1024);
|
||||
private final ByteBufferBytes out = new ByteBufferBytes(outBuffer.slice());
|
||||
private final ByteBufferBytes in = new ByteBufferBytes(allocateDirect(1024));
|
||||
private ByteBufferBytes in = new ByteBufferBytes(allocateDirect(1024));
|
||||
|
||||
private final KeyValueSerializer<K, V> keyValueSerializer;
|
||||
|
||||
@@ -327,9 +327,7 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
writeValue(value);
|
||||
|
||||
// get the data back from the server
|
||||
|
||||
return readKey(sizeLocation);
|
||||
|
||||
}
|
||||
|
||||
public synchronized V remove(Object key) {
|
||||
@@ -527,6 +525,9 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
|
||||
// the number of bytes in the response
|
||||
int size = receive(2, timeoutTime).readUnsignedShort();
|
||||
|
||||
if (in.capacity() < size)
|
||||
in = new ByteBufferBytes(allocateDirect(size));
|
||||
|
||||
receive(size, timeoutTime);
|
||||
|
||||
boolean isException = in.readBoolean();
|
||||
|
||||
Reference in New Issue
Block a user