Skip to content

Commit 6373dd6

Browse files
author
Stephane Landelle
committed
Merge pull request AsyncHttpClient#412 from carryel/master
Fixed infinite loop of MultipartBodyTest for master branch.
2 parents e4c5c77 + 0f76156 commit 6373dd6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

api/src/main/java/org/asynchttpclient/multipart/MultipartBody.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public long read(ByteBuffer buffer) throws IOException {
8181
int maxLength = buffer.remaining();
8282

8383
if (startPart == parts.size() && endWritten) {
84-
return overallLength;
84+
return -1;
8585
}
8686

8787
boolean full = false;

api/src/test/java/org/asynchttpclient/multipart/MultipartBodyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private static void compareContentLength(final List<Part> parts) {
9191
} catch (IOException ie) {
9292
Assert.fail("read failure");
9393
}
94-
if (readBytes >= 0) {
94+
if (readBytes > 0) {
9595
totalBytes += readBytes;
9696
} else {
9797
last = true;

0 commit comments

Comments
 (0)