File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/main/java/com/ning/http/client/providers/netty/request/body Expand file tree Collapse file tree 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 {
8888 }
8989 int capacity = buffer .remaining () - 10 ; // be safe (we'll have to add size, ending, etc.)
9090 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 );
9598 }
96- buffer .put (END_PADDING );
9799 if (!nextPart .buffer .hasRemaining ()) {
98100 if (nextPart .isLast ) {
99101 finishState = CLOSING ;
You can’t perform that action at this time.
0 commit comments