[#1007] Make sure the current message is only reset on LastHttpContent
This commit is contained in:
parent
268b059ebb
commit
c8de4f03f1
@ -153,7 +153,9 @@ public class HttpObjectAggregator extends MessageToMessageDecoder<HttpObject> {
|
|||||||
assert currentMessage != null;
|
assert currentMessage != null;
|
||||||
|
|
||||||
if (tooLongFrameFound) {
|
if (tooLongFrameFound) {
|
||||||
this.currentMessage = null;
|
if (msg instanceof LastHttpContent) {
|
||||||
|
this.currentMessage = null;
|
||||||
|
}
|
||||||
// already detect the too long frame so just discard the content
|
// already detect the too long frame so just discard the content
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -111,6 +111,7 @@ public class HttpObjectAggregatorTest {
|
|||||||
HttpContent chunk1 = new DefaultHttpContent(Unpooled.copiedBuffer("test", CharsetUtil.US_ASCII));
|
HttpContent chunk1 = new DefaultHttpContent(Unpooled.copiedBuffer("test", CharsetUtil.US_ASCII));
|
||||||
HttpContent chunk2 = new DefaultHttpContent(Unpooled.copiedBuffer("test2", CharsetUtil.US_ASCII));
|
HttpContent chunk2 = new DefaultHttpContent(Unpooled.copiedBuffer("test2", CharsetUtil.US_ASCII));
|
||||||
HttpContent chunk3 = new DefaultHttpContent(Unpooled.copiedBuffer("test3", CharsetUtil.US_ASCII));
|
HttpContent chunk3 = new DefaultHttpContent(Unpooled.copiedBuffer("test3", CharsetUtil.US_ASCII));
|
||||||
|
HttpContent chunk4 = LastHttpContent.EMPTY_LAST_CONTENT;
|
||||||
|
|
||||||
assertFalse(embedder.writeInbound(message));
|
assertFalse(embedder.writeInbound(message));
|
||||||
assertFalse(embedder.writeInbound(chunk1.copy()));
|
assertFalse(embedder.writeInbound(chunk1.copy()));
|
||||||
@ -121,6 +122,7 @@ public class HttpObjectAggregatorTest {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
assertFalse(embedder.writeInbound(chunk3.copy()));
|
assertFalse(embedder.writeInbound(chunk3.copy()));
|
||||||
|
assertFalse(embedder.writeInbound(chunk4.copy()));
|
||||||
|
|
||||||
assertFalse(embedder.writeInbound(message));
|
assertFalse(embedder.writeInbound(message));
|
||||||
assertFalse(embedder.writeInbound(chunk1.copy()));
|
assertFalse(embedder.writeInbound(chunk1.copy()));
|
||||||
@ -131,6 +133,7 @@ public class HttpObjectAggregatorTest {
|
|||||||
// expected
|
// expected
|
||||||
}
|
}
|
||||||
assertFalse(embedder.writeInbound(chunk3.copy()));
|
assertFalse(embedder.writeInbound(chunk3.copy()));
|
||||||
|
assertFalse(embedder.writeInbound(chunk4.copy()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = IllegalArgumentException.class)
|
@Test(expected = IllegalArgumentException.class)
|
||||||
|
Loading…
Reference in New Issue
Block a user