Skip to content

Commit adf8ca8

Browse files
consumer limit check fix (#1055) (#1057)
Co-authored-by: Laura Trotta <[email protected]>
1 parent 8ce7fb6 commit adf8ca8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java-client/src/main/java/co/elastic/clients/transport/rest5_client/low_level/BufferedByteConsumer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected int capacityIncrement() {
5555

5656
@Override
5757
protected void data(final ByteBuffer src, final boolean endOfStream) throws ContentTooLongException {
58-
if (src.capacity() > limit) {
58+
if (buffer.length() + src.limit() > limit) {
5959
throw new ContentTooLongException(
6060
"entity content is too long [" + src.capacity() + "] for the configured buffer limit [" + limit + "]"
6161
);

0 commit comments

Comments
 (0)