Http2RequestDecoder(ServerConfig cfg, Channel channel, Http2ConnectionEncoder writer) { this.cfg = cfg; this.channel = channel; this.writer = writer; inboundTrafficController = InboundTrafficController.ofHttp2(channel, cfg.http2InitialConnectionWindowSize()); goAwayHandler = new Http2GoAwayHandler(); }
private void handleHttp2Settings(ChannelHandlerContext ctx, Http2Settings h2settings) { if (h2settings.isEmpty()) { logger.trace("{} HTTP/2 settings: <empty>", ctx.channel()); } else { logger.debug("{} HTTP/2 settings: {}", ctx.channel(), h2settings); } if (protocol == H1) { protocol = H2; } else if (protocol == H1C) { protocol = H2C; } final ChannelPipeline pipeline = ctx.pipeline(); final Http2ConnectionHandler handler = pipeline.get(Http2ConnectionHandler.class); if (responseEncoder == null) { responseEncoder = new Http2ObjectEncoder(ctx, handler.encoder()); } else if (responseEncoder instanceof Http1ObjectEncoder) { responseEncoder.close(); responseEncoder = new Http2ObjectEncoder(ctx, handler.encoder()); } // Update the connection-level flow-control window size. final int initialWindow = config.http2InitialConnectionWindowSize(); if (initialWindow > DEFAULT_WINDOW_SIZE) { incrementLocalWindowSize(pipeline, initialWindow - DEFAULT_WINDOW_SIZE); } }
@Override public String toString() { String strVal = this.strVal; if (strVal == null) { this.strVal = strVal = toString( getClass(), ports(), null, virtualHosts(), workerGroup(), shutdownWorkerGroupOnStop(), maxNumConnections(), idleTimeoutMillis(), defaultRequestTimeoutMillis(), defaultMaxRequestLength(), verboseResponses(), http2InitialConnectionWindowSize(), http2InitialStreamWindowSize(), http2MaxStreamsPerConnection(), http2MaxFrameSize(), http2MaxHeaderListSize(), http1MaxInitialLineLength(), http1MaxHeaderSize(), http1MaxChunkSize(), proxyProtocolMaxTlvSize(), gracefulShutdownQuietPeriod(), gracefulShutdownTimeout(), blockingTaskExecutor(), meterRegistry(), serviceLoggerPrefix(), accessLogWriter(), shutdownAccessLogWriterOnStop(), channelOptions(), childChannelOptions(), clientAddressSources(), clientAddressTrustedProxyFilter(), clientAddressFilter() ); } return strVal; }