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