File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/main/java/com/ning/http/client/providers/netty Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,14 @@ public long read(final ByteBuffer buffer) throws IOException {
75
75
}
76
76
int capacity = buffer .remaining () - 10 ; // be safe (we'll have to add size, ending, etc.)
77
77
int size = Math .min (nextPart .buffer .remaining (), capacity );
78
- buffer .put (getBytes (Integer .toHexString (size )));
79
- buffer .put (END_PADDING );
80
- for (int i = 0 ; i < size ; i ++) {
81
- buffer .put (nextPart .buffer .get ());
78
+ if (size != 0 ) {
79
+ buffer .put (getBytes (Integer .toHexString (size )));
80
+ buffer .put (END_PADDING );
81
+ for (int i = 0 ; i < size ; i ++) {
82
+ buffer .put (nextPart .buffer .get ());
83
+ }
84
+ buffer .put (END_PADDING );
82
85
}
83
- buffer .put (END_PADDING );
84
86
if (!nextPart .buffer .hasRemaining ()) {
85
87
if (nextPart .isLast ) {
86
88
finishState = CLOSING ;
You can’t perform that action at this time.
0 commit comments