问题描述:
在HTTP连接下,chunk data通过 response正确返回。在https连接下,没有response返回。
问题原因:
public class HttpServerPipelineFactory implements ChannelPipelineFactory {
public ChannelPipeline getPipeline() throws Exception {
pipeline.addLast("chunkedWriter", playHandler.chunkedWriteHandler);
public class SslHttpServerPipelineFactory implements ChannelPipelineFactory {
public ChannelPipeline getPipeline() throws Exception {
pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
http下,chunkedWriter是playHandler.chunkedWriteHandler。而https的时候,chunkedWriter是新规的,与playHandler没有关联,导致playHandler refresh的时候,chunkedWriter是空的,直接返回而没有flush response.
如果使用firefox的开发工具查看的话,可以确认到没有返回response.
对应方法:
通过分析原因,我们可以找到解决方法。
pipeline.addLast("chunkedWriter", sslplayHandler.chunkedWriteHandler);