Example usage for io.netty.handler.codec.http FullHttpResponse copy

List of usage examples for io.netty.handler.codec.http FullHttpResponse copy

Introduction

In this page you can find the example usage for io.netty.handler.codec.http FullHttpResponse copy.

Prototype

@Override
    FullHttpResponse copy();

Source Link

Usage

From source file:org.ballerinalang.test.util.http2.HTTP2ResponseHandler.java

License:Open Source License

@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
    Integer streamId = msg.headers().getInt(HttpConversionUtil.ExtensionHeaderNames.STREAM_ID.text());
    if (streamId == null) {
        log.error("HTTP2ResponseHandler unexpected message received: " + msg);
        return;//from w  w  w  .j  a  va  2s  .com
    }
    Entry<ChannelFuture, ChannelPromise> entry = streamIdPromiseMap.get(streamId);
    if (entry == null) {
        if (streamId == 1) {
            log.error("HTTP2 Upgrade request has received from  stream : " + streamId);
        }
    } else {
        streamIdResponseMap.put(streamId, msg.copy());
        entry.getValue().setSuccess();
    }
}