File tree 1 file changed +7
-5
lines changed
src/main/java/com/ning/http/client/providers/netty/request/body 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -88,12 +88,14 @@ public long read(final ByteBuffer buffer) throws IOException {
88
88
}
89
89
int capacity = buffer .remaining () - 10 ; // be safe (we'll have to add size, ending, etc.)
90
90
int size = Math .min (nextPart .buffer .remaining (), capacity );
91
- buffer .put (Integer .toHexString (size ).getBytes (US_ASCII ));
92
- buffer .put (END_PADDING );
93
- for (int i = 0 ; i < size ; i ++) {
94
- buffer .put (nextPart .buffer .get ());
91
+ if (size != 0 ) {
92
+ buffer .put (Integer .toHexString (size ).getBytes (US_ASCII ));
93
+ buffer .put (END_PADDING );
94
+ for (int i = 0 ; i < size ; i ++) {
95
+ buffer .put (nextPart .buffer .get ());
96
+ }
97
+ buffer .put (END_PADDING );
95
98
}
96
- buffer .put (END_PADDING );
97
99
if (!nextPart .buffer .hasRemaining ()) {
98
100
if (nextPart .isLast ) {
99
101
finishState = CLOSING ;
You can’t perform that action at this time.
0 commit comments