Last active
April 5, 2016 10:09
-
-
Save nickman/44fafb1fe06546b40c2dd96f0ca0f53f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Modifies the pipeline to handle HTTP requests | |
* @param ctx The calling channel handler context | |
* @param maxRequestSize The maximum request size in bytes | |
*/ | |
private void switchToHttp(final ChannelHandlerContext ctx, final int maxRequestSize) { | |
ChannelPipeline p = ctx.pipeline(); | |
p.addLast("compressor", new HttpContentCompressor()); | |
p.addLast("httpHandler", new HttpServerCodec()); // TODO: config ? | |
p.addLast("decompressor", new HttpContentDecompressor()); | |
p.addLast("aggregator", new HttpObjectAggregator(maxRequestSize)); | |
p.addLast("handler", rpchandler); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment