Skip to content
Permalink
Browse files
throw 0x41 for large request in hessian InputStream & OutputStream (#23)
fixes #22
  • Loading branch information
chickenlj committed Mar 16, 2020
2 parents cc56e1b + 3078e6e commit a3e490aeea2231fed1782553f95489a1e8e1d3e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
@@ -21,7 +21,7 @@
<groupId>com.alibaba</groupId>
<artifactId>hessian-lite</artifactId>
<packaging>jar</packaging>
<version>3.2.5-SNAPSHOT</version>
<version>3.2.7-SNAPSHOT</version>
<name>Hessian Lite(Alibaba embed version)</name>

<properties>
@@ -3360,8 +3360,9 @@ public InputStream readInputStream()
case 'N':
return null;

case 'B':
case 'b':
case BC_BINARY:
case BC_BINARY_CHUNK:
case 'b': //maybe it's a mistype of BC_BINARY_CHUNK
_isLastChunk = tag == 'B';
_chunkLength = (read() << 8) + read();
break;
@@ -3385,7 +3386,10 @@ public InputStream readInputStream()
_isLastChunk = true;
_chunkLength = tag - 0x20;
break;

case 0x34: case 0x35: case 0x36: case 0x37:
_isLastChunk = true;
_chunkLength = (tag - 0x34) * 256 + read();
break;
default:
throw expect("binary", tag);
}
@@ -3408,13 +3412,14 @@ int read(byte[] buffer, int offset, int length)
int code = read();

switch (code) {
case 'b':
case BC_BINARY_CHUNK:
case 'b': //maybe it's a mistype of BC_BINARY_CHUNK
_isLastChunk = false;

_chunkLength = (read() << 8) + read();
break;

case 'B':
case BC_BINARY:
_isLastChunk = true;

_chunkLength = (read() << 8) + read();
@@ -3439,7 +3444,10 @@ int read(byte[] buffer, int offset, int length)
_isLastChunk = true;
_chunkLength = code - 0x20;
break;

case 0x34: case 0x35: case 0x36: case 0x37:
_isLastChunk = true;
_chunkLength = (code - 0x34) * 256 + read();
break;
default:
throw expect("byte[]", code);
}

0 comments on commit a3e490a

Please sign in to comment.