fixing build - adjusting some strange code to smaller blocking factor
This commit is contained in:
parent
b6fdbe42dd
commit
cdf78aee1e
|
@ -322,7 +322,7 @@ public class BinaryProtocol implements BinaryProtocolCommands {
|
|||
setController(newVersion);
|
||||
}
|
||||
|
||||
private byte[] receivePacket(String msg, boolean allowLongResponse) throws EOFException {
|
||||
private byte[] receivePacket(String msg, boolean allowLongResponse) throws IOException {
|
||||
long start = System.currentTimeMillis();
|
||||
synchronized (ioLock) {
|
||||
return incomingData.getPacket(msg, allowLongResponse, start);
|
||||
|
@ -465,12 +465,6 @@ public class BinaryProtocol implements BinaryProtocolCommands {
|
|||
}
|
||||
|
||||
public void writeData(byte[] content, Integer offset, int size) {
|
||||
if (size > Fields.BLOCKING_FACTOR) {
|
||||
writeData(content, offset, Fields.BLOCKING_FACTOR);
|
||||
writeData(content, offset + Fields.BLOCKING_FACTOR, size - Fields.BLOCKING_FACTOR);
|
||||
return;
|
||||
}
|
||||
|
||||
isBurnPending = true;
|
||||
|
||||
byte packet[] = new byte[5 + size];
|
||||
|
|
|
@ -69,7 +69,7 @@ public class IncomingDataBuffer {
|
|||
if (packetSize < 0)
|
||||
return null;
|
||||
if (!allowLongResponse && packetSize > Math.max(Fields.BLOCKING_FACTOR, Fields.TS_OUTPUT_SIZE) + 10)
|
||||
return null;
|
||||
throw new IllegalArgumentException(packetSize + " packet while not allowLongResponse");
|
||||
|
||||
isTimeout = waitForBytes(loggingPrefix + msg + " body", start, packetSize + 4);
|
||||
if (isTimeout)
|
||||
|
|
|
@ -25,7 +25,7 @@ public class HelloCommand implements Command {
|
|||
|
||||
@Nullable
|
||||
public static String getHelloResponse(IncomingDataBuffer incomingData) throws EOFException {
|
||||
byte[] response = incomingData.getPacket("[hello]");
|
||||
byte[] response = incomingData.getPacket("[hello]", true);
|
||||
if (!checkResponseCode(response, BinaryProtocolCommands.RESPONSE_OK))
|
||||
return null;
|
||||
return new String(response, 1, response.length - 1);
|
||||
|
|
Loading…
Reference in New Issue