Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f0330a

Browse files
committed
avoid writing 2 new lines without content
Fix the following error happening on the server side:java.lang.NullPointerException: nullat org.jboss.netty.handler.codec.http.HttpClientCodec$Decoder.isContentAlwaysEmpty(HttpClientCodec.java:179) ~[netty-3.9.2.Final.jar:na]
1 parent1aa0d6e commit2f0330a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎src/main/java/com/ning/http/client/providers/netty/FeedableBodyGenerator.java‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ public long read(final ByteBuffer buffer) throws IOException {
7575
}
7676
intcapacity =buffer.remaining() -10;// be safe (we'll have to add size, ending, etc.)
7777
intsize =Math.min(nextPart.buffer.remaining(),capacity);
78-
buffer.put(getBytes(Integer.toHexString(size)));
79-
buffer.put(END_PADDING);
80-
for (inti =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 (inti =0;i <size;i++) {
82+
buffer.put(nextPart.buffer.get());
83+
}
84+
buffer.put(END_PADDING);
8285
}
83-
buffer.put(END_PADDING);
8486
if (!nextPart.buffer.hasRemaining()) {
8587
if (nextPart.isLast) {
8688
finishState =CLOSING;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp