0

我使用 netty 4.0.9(或 12)HttpUploadClient 方式来发送大型(>8K)发布请求。但是,在第一个块发送到服务器后,服务器发回“100 continue”。ChunkedWriteHandler 没有处理“100 Continue”来发送剩余的块。相反,100 Continue 在无法处理的顶级处理程序的上游传递。如何修改 ChunkedWriteHandler 以处理“100 Continue”响应以恢复发送剩余块以完成大型 post 请求?

4

2 回答 2

0

此错误已在 4.0.15 中针对 AbstractMemoryHttpData.java getChunk() 函数修复。

异常是 AbstractByteBuf.java 中的 IllegalReferenceCountException。

但是,在 ChunkedWriteHandler.java doFlush() 中,有 catch(final Throwable t),它可能会阻止任何未来的其他异常传播,除非明确检查它。

于 2014-03-07T21:05:09.623 回答
0

ChunkedWriteHandler is a protocol agnostic handler, so you should not add anything specific to HTTP.

Instead, you could update your last handler in the pipeline so that it understands 100-Continue message. Before writing any chunks, you'd better wait for 100-Continue response first.

Alternatively, you could just remove the Expect: 100-continue header from your request, then the HTTP server will not send such a response.

于 2013-11-15T02:01:08.453 回答