Fixed issue with RMI registration validation fragmentation count
This commit is contained in:
parent
9d9082903a
commit
450f1aa5fb
|
@ -146,7 +146,7 @@ class RegistrationWrapperClient extends RegistrationWrapper {
|
||||||
private static
|
private static
|
||||||
byte[][] divideArray(byte[] source, int chunksize) {
|
byte[][] divideArray(byte[] source, int chunksize) {
|
||||||
|
|
||||||
int fragments = (int) Math.ceil(source.length / ((double) chunksize + 2));
|
int fragments = (int) Math.ceil(source.length / ((double) chunksize));
|
||||||
if (fragments > 127) {
|
if (fragments > 127) {
|
||||||
// cannot allow more than 127
|
// cannot allow more than 127
|
||||||
return null;
|
return null;
|
||||||
|
@ -166,8 +166,8 @@ class RegistrationWrapperClient extends RegistrationWrapper {
|
||||||
length = chunksize;
|
length = chunksize;
|
||||||
}
|
}
|
||||||
splitArray[i] = new byte[length + 2];
|
splitArray[i] = new byte[length + 2];
|
||||||
splitArray[i][0] = (byte) i;
|
splitArray[i][0] = (byte) i; // index
|
||||||
splitArray[i][1] = (byte) fragments;
|
splitArray[i][1] = (byte) fragments; // total number of fragments
|
||||||
System.arraycopy(source, start, splitArray[i], 2, length);
|
System.arraycopy(source, start, splitArray[i], 2, length);
|
||||||
|
|
||||||
start += chunksize;
|
start += chunksize;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user