Skip to content

Commit 54def5a

Browse files
committed
Fix Multipart over HTTP, close AsyncHttpClient#1013
1 parent ffe5390 commit 54def5a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/ning/http/client/multipart/MultipartBody.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ public byte[] getBoundary() {
7676
// RandomAccessBody API, suited for HTTP but not for HTTPS
7777
public long transferTo(long position, WritableByteChannel target) throws IOException {
7878

79-
long overallLength = 0;
80-
8179
if (transfertDone) {
82-
return contentLength;
80+
return -1;
8381
}
8482

83+
long overallLength = 0;
84+
8585
for (Part part : parts) {
8686
overallLength += part.write(target, boundary);
8787
}

0 commit comments

Comments
 (0)