Skip to content

Commit 0f76156

Browse files
committed
MultipartBody#read() returns -1 when it meets EOF.
Current MultipartBody#read() returns only 0 when it meets both Exception and EOF(endWritten). Then caller can't know whether the value is EOF or Error.
1 parent a4f00a0 commit 0f76156

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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;

0 commit comments

Comments
 (0)