Refine search
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_AGGREGATE_SIZE)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new CoordinatorAdminRequestHandler(storeClientConfigs)); return pipeline; }
ChannelPipeline pipeline = Channels.pipeline(); HttpRequestDecoder requestDecoder = new HttpRequestDecoder(transport.maxInitialLineLength, transport.maxHeaderSize, transport.maxChunkSize); if (transport.maxCumulationBufferCapacity > 0) { requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity); requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("decoder", requestDecoder); if (transport.compression) { pipeline.addLast("decoder_compress", new HttpContentDecompressor()); HttpChunkAggregator httpChunkAggregator = new HttpChunkAggregator(transport.maxContentLength); if (transport.maxCompositeBufferComponents != -1) { httpChunkAggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("aggregator", httpChunkAggregator); pipeline.addLast("encoder", new HttpResponseEncoder()); if (transport.compression) { pipeline.addLast("encoder_compress", new HttpContentCompressor(transport.compressionLevel));
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = pipeline(); pipeline.addLast("requestEncoder", new HttpRequestEncoder()); pipeline.addLast("channelEncoder", new HttpEncoder(host, uri)); pipeline.addLast("responseDecoder", new HttpResponseDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); pipeline.addLast("thriftHandler", (ChannelHandler)handler); return pipeline; } }
ctx.getPipeline().addLast("fake-aggregator", new HttpChunkAggregator(max)); try { WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory(this.getWebSocketLocation(req), null, false); ctx.getPipeline().remove("fake-aggregator"); } catch (Exception e) {
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline cp = Channels.pipeline(); cp.addLast("httpClientCodec", new HttpClientCodec()); cp.addLast("chunkAggregator", new HttpChunkAggregator(maxFrameSize)); if (clientConfig.sslClientConfiguration() != null) { cp.addFirst("ssl", clientConfig.sslClientConfiguration().createHandler(address)); } return cp; } };
@Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline( new HttpRequestDecoder(), new HttpChunkAggregator(1 << 16), new HttpResponseEncoder(), new ChunkedWriteHandler(), shuffleHandler); } }
@Override protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) { final LinkedHashMap<String, Callable<? extends ChannelHandler>> baseChannelHandlers = super.getBaseChannelHandlers(input); if (idleWriterTimeout > 0) { // Install read timeout handler to close idle connections after a timeout. // This avoids dangling HTTP connections when the HTTP client does not close the connection properly. // For details see: https://github.com/Graylog2/graylog2-server/issues/3223#issuecomment-270350500 baseChannelHandlers.put("read-timeout-handler", () -> new ReadTimeoutHandler(timer, idleWriterTimeout, TimeUnit.SECONDS)); } baseChannelHandlers.put("decoder", () -> new HttpRequestDecoder(DEFAULT_MAX_INITIAL_LINE_LENGTH, DEFAULT_MAX_HEADER_SIZE, maxChunkSize)); baseChannelHandlers.put("aggregator", () -> new HttpChunkAggregator(maxChunkSize)); baseChannelHandlers.put("encoder", HttpResponseEncoder::new); baseChannelHandlers.put("decompressor", HttpContentDecompressor::new); return baseChannelHandlers; }
/** * Creates a new instance with the specified parameters. */ protected RtspMessageDecoder(int maxInitialLineLength, int maxHeaderSize, int maxContentLength) { super(maxInitialLineLength, maxHeaderSize, maxContentLength * 2); aggregator = new DecoderEmbedder<HttpMessage>(new HttpChunkAggregator(maxContentLength)); }
appendToCumulation(chunk.getContent());
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("openChannels", transport.serverOpenChannels); HttpRequestDecoder requestDecoder = new HttpRequestDecoder( (int) transport.maxInitialLineLength.bytes(), (int) transport.maxHeaderSize.bytes(), if (transport.maxCumulationBufferCapacity != null) { if (transport.maxCumulationBufferCapacity.bytes() > Integer.MAX_VALUE) { requestDecoder.setMaxCumulationBufferCapacity(Integer.MAX_VALUE); } else { requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity.bytes()); requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("decoder", requestDecoder); if (transport.compression) { pipeline.addLast("decoder_compress", new HttpContentDecompressor()); HttpChunkAggregator httpChunkAggregator = new HttpChunkAggregator((int) transport.maxContentLength.bytes()); if (transport.maxCompositeBufferComponents != -1) { httpChunkAggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("aggregator", httpChunkAggregator); pipeline.addLast("encoder", new HttpResponseEncoder()); if (transport.compression) { pipeline.addLast("encoder_compress", new HttpContentCompressor(transport.compressionLevel));
public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); if (sslHandler != null) { pipeline.addLast("ssl", sslHandler); } pipeline.addLast("decoder", new HttpResponseDecoder()); // Uncomment the following line if you don't want to handle HttpChunks. pipeline.addLast("aggregator", new HttpChunkAggregator(MAX_CONTENT_SIZE)); pipeline.addLast("encoder", new HttpRequestEncoder()); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { return Channels.pipeline(new HttpRequestDecoder(), new HttpChunkAggregator(65536), new HttpResponseEncoder(), new CredentialsLogicHandler(token, url.toString())); } });
public class WebSocketServerPipelineFactory implements ChannelPipelineFactory { public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(65536)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("handler", new YourBusinessHandler()); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); pipeline.addLast("connectionStats", connectionStatsHandler); pipeline.addLast("decoder", new HttpRequestDecoder()); pipeline.addLast("aggregator", new HttpChunkAggregator(maxHttpContentLength)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("deflater", new HttpContentCompressor()); pipeline.addLast("handler", new RestServerRequestHandler(storeRepository)); pipeline.addLast("storageExecutionHandler", storageExecutionHandler); return pipeline; }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); pipeline.addLast("openChannels", transport.serverOpenChannels); HttpRequestDecoder requestDecoder = new HttpRequestDecoder( (int) transport.maxInitialLineLength.getBytes(), (int) transport.maxHeaderSize.getBytes(), if (transport.maxCumulationBufferCapacity.getBytes() >= 0) { if (transport.maxCumulationBufferCapacity.getBytes() > Integer.MAX_VALUE) { requestDecoder.setMaxCumulationBufferCapacity(Integer.MAX_VALUE); } else { requestDecoder.setMaxCumulationBufferCapacity((int) transport.maxCumulationBufferCapacity.getBytes()); requestDecoder.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("decoder", requestDecoder); pipeline.addLast("decoder_compress", new HttpContentDecompressor()); HttpChunkAggregator httpChunkAggregator = new HttpChunkAggregator((int) transport.maxContentLength.getBytes()); if (transport.maxCompositeBufferComponents != -1) { httpChunkAggregator.setMaxCumulationBufferComponents(transport.maxCompositeBufferComponents); pipeline.addLast("aggregator", httpChunkAggregator);
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); Timer timer = new HashedWheelTimer(); pipeline.addLast("timeout", new ReadTimeoutHandler(timer, 30)); pipeline.addLast("codec", new HttpClientCodec()); if (ssl) { SSLContext sslContext = SSLContext.getInstance("TLS"); //sslContext.init(keyManagers, trustManagers, null); SSLEngine engine = sslContext.createSSLEngine(); engine.setUseClientMode(true); pipeline.addLast("ssl", new SslHandler(engine)); } //handle HttpChunks pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); //automatic content decompression //pipeline.addLast("inflater", new HttpContentDecompressor()); pipeline.addLast("handler", new HttpResponseHandler()); return pipeline; } }
pipeline.addLast("decoder", new HttpRequestDecoder(4096, 4096, 100*1024*1024)); pipeline.addLast("aggregator", new HttpChunkAggregator(100*1024*1024)); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("hndlr", new FrontendHandler(...));
/** * Add all {@link ChannelHandler}'s that are needed for HTTP. */ protected void addHttpHandlers(ChannelHandlerContext ctx) { ChannelPipeline pipeline = ctx.getPipeline(); pipeline.addLast("httpRequestDecoder", new HttpRequestDecoder()); pipeline.addLast("httpResponseEncoder", new HttpResponseEncoder()); pipeline.addLast("httpChunkAggregator", new HttpChunkAggregator(maxHttpContentLength)); pipeline.addLast("httpRequestHandler", createHttpRequestHandlerForHttp()); }
@Override public ChannelPipeline getPipeline() throws Exception { ChannelPipeline pipeline = Channels.pipeline(); if (sslFactory != null) { pipeline.addLast("ssl", new SslHandler(sslFactory.createSSLEngine())); } int maxChunkSize = getConfig().getInt(ConfVars.SHUFFLE_FETCHER_CHUNK_MAX_SIZE.varname, ConfVars.SHUFFLE_FETCHER_CHUNK_MAX_SIZE.defaultIntVal); pipeline.addLast("codec", new HttpServerCodec(4096, 8192, maxChunkSize)); pipeline.addLast("aggregator", new HttpChunkAggregator(1 << 16)); pipeline.addLast("chunking", new ChunkedWriteHandler()); pipeline.addLast("shuffle", PullServer); return pipeline; // TODO factor security manager into pipeline // TODO factor out encode/decode to permit binary shuffle // TODO factor out decode of index to permit alt. models } }
public ChannelPipeline getPipeline() throws Exception { List<ChannelHandler> handlers = new ArrayList<ChannelHandler>(); if (sslEnabled && !useServlet) { SSLEngine engine = context.createSSLEngine(); engine.setUseClientMode(true); engine.setWantClientAuth(true); SslHandler handler = new SslHandler(engine); handlers.add(handler); } if (httpEnabled) { handlers.add(new HttpRequestEncoder()); handlers.add(new HttpResponseDecoder()); handlers.add(new HttpChunkAggregator(Integer.MAX_VALUE)); handlers.add(new HttpHandler()); } handlers.add(new HornetQFrameDecoder2()); handlers.add(new HornetQClientChannelHandler(channelGroup, handler, new Listener())); ChannelPipeline pipeline = new StaticChannelPipeline(handlers.toArray(new ChannelHandler[handlers.size()])); return pipeline; } });