@Test public void shouldCreateAServerConnectorWithConfiguredPortAndBuffersize() throws Exception { assertThat(connector.getPort(), is(1234)); assertThat(connector.getHost(), is("foo")); assertThat(connector.getIdleTimeout(), is(200l)); assertThat(configuration.getOutputBufferSize(), is(100)); }
@Test public void shouldSetupHttpConnectionFactory() { ServerConnector connector = (ServerConnector) sslSocketConnector.getConnector(); Collection<ConnectionFactory> connectionFactories = connector.getConnectionFactories(); HttpConnectionFactory httpConnectionFactory = getHttpConnectionFactory(connectionFactories); assertThat(httpConnectionFactory.getHttpConfiguration().getOutputBufferSize(), is(100)); assertThat(httpConnectionFactory.getHttpConfiguration().getCustomizers().size(), is(2)); assertThat(httpConnectionFactory.getHttpConfiguration().getCustomizers().get(0), instanceOf(SecureRequestCustomizer.class)); assertThat(httpConnectionFactory.getHttpConfiguration().getCustomizers().get(1), instanceOf(ForwardedRequestCustomizer.class)); }
public HttpOutput(HttpChannel<?> channel) { _channel = channel; _bufferSize = _channel.getHttpConfiguration().getOutputBufferSize(); }
public GzipHttpOutputInterceptor(GzipFactory factory, HttpChannel channel, HttpOutput.Interceptor next,boolean syncFlush) { this(factory,VARY_ACCEPT_ENCODING_USER_AGENT,channel.getHttpConfiguration().getOutputBufferSize(),channel,next,syncFlush); }
public GzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, HttpChannel channel, HttpOutput.Interceptor next,boolean syncFlush) { this(factory,vary,channel.getHttpConfiguration().getOutputBufferSize(),channel,next,syncFlush); }
public HttpOutput(HttpChannel<?> channel) { _channel = channel; _bufferSize = _channel.getHttpConfiguration().getOutputBufferSize(); }
public GzipHttpOutputInterceptor(GzipFactory factory, HttpField vary, HttpChannel channel, HttpOutput.Interceptor next,boolean syncFlush) { this(factory,vary,channel.getHttpConfiguration().getOutputBufferSize(),channel,next,syncFlush); }
public GzipHttpOutputInterceptor(GzipFactory factory, HttpChannel channel, HttpOutput.Interceptor next,boolean syncFlush) { this(factory,VARY_ACCEPT_ENCODING_USER_AGENT,channel.getHttpConfiguration().getOutputBufferSize(),channel,next,syncFlush); }
public HttpOutput(HttpChannel<?> channel) { _channel = channel; HttpConfiguration config = channel.getHttpConfiguration(); _bufferSize = config.getOutputBufferSize(); _commitSize = config.getOutputAggregationSize(); if (_commitSize>_bufferSize) { LOG.warn("OutputAggregationSize {} exceeds bufferSize {}",_commitSize,_bufferSize); _commitSize=_bufferSize; } }
public void reset() { HttpConfiguration config = _channel.getHttpConfiguration(); _bufferSize = config.getOutputBufferSize(); _commitSize = config.getOutputAggregationSize(); if (_commitSize>_bufferSize) { LOG.warn("OutputAggregationSize {} exceeds bufferSize {}",_commitSize,_bufferSize); _commitSize=_bufferSize; } _written = 0; reopen(); }
public HttpOutput(HttpChannel channel) { _channel = channel; _interceptor = channel; _writeBlocker = new WriteBlocker(channel); HttpConfiguration config = channel.getHttpConfiguration(); _bufferSize = config.getOutputBufferSize(); _commitSize = config.getOutputAggregationSize(); if (_commitSize > _bufferSize) { LOG.warn("OutputAggregationSize {} exceeds bufferSize {}", _commitSize, _bufferSize); _commitSize = _bufferSize; } }
public void recycle() { _interceptor = _channel; HttpConfiguration config = _channel.getHttpConfiguration(); _bufferSize = config.getOutputBufferSize(); _commitSize = config.getOutputAggregationSize(); if (_commitSize > _bufferSize) _commitSize = _bufferSize; releaseBuffer(); _written = 0; _writeListener = null; _onError = null; _firstByteTimeStamp = -1; _flushed = 0; reopen(); }
public HttpOutput(HttpChannel channel) { _channel = channel; _interceptor = channel; _writeBlock = new SharedBlockingCallback() { @Override protected long getIdleTimeout() { long bto = getHttpChannel().getHttpConfiguration().getBlockingTimeout(); if (bto>0) return bto; if (bto<0) return -1; return _channel.getIdleTimeout(); } }; HttpConfiguration config = channel.getHttpConfiguration(); _bufferSize = config.getOutputBufferSize(); _commitSize = config.getOutputAggregationSize(); if (_commitSize>_bufferSize) { LOG.warn("OutputAggregationSize {} exceeds bufferSize {}",_commitSize,_bufferSize); _commitSize=_bufferSize; } }
if (httpConfig.getSecurePort() == 0) httpConfig.setSecurePort(securePort != 0 ? securePort : 8443); if (httpConfig.getOutputBufferSize() == 0) httpConfig.setOutputBufferSize(32768);
int size = Math.max(_channel.getHttpConfiguration().getOutputBufferSize(),BufferUtil.length(content));
@Override public Connection newConnection(Connector connector, EndPoint endPoint) { ServerSessionListener listener = newSessionListener(connector, endPoint); Generator generator = new Generator(connector.getByteBufferPool(), getMaxDynamicTableSize(), getMaxHeaderBlockFragment()); FlowControlStrategy flowControl = getFlowControlStrategyFactory().newFlowControlStrategy(); HTTP2ServerSession session = new HTTP2ServerSession(connector.getScheduler(), endPoint, generator, listener, flowControl); session.setMaxLocalStreams(getMaxConcurrentStreams()); session.setMaxRemoteStreams(getMaxConcurrentStreams()); // For a single stream in a connection, there will be a race between // the stream idle timeout and the connection idle timeout. However, // the typical case is that the connection will be busier and the // stream idle timeout will expire earlier than the connection's. long streamIdleTimeout = getStreamIdleTimeout(); if (streamIdleTimeout <= 0) streamIdleTimeout = endPoint.getIdleTimeout(); session.setStreamIdleTimeout(streamIdleTimeout); session.setInitialSessionRecvWindow(getInitialSessionRecvWindow()); session.setWriteThreshold(getHttpConfiguration().getOutputBufferSize()); ServerParser parser = newServerParser(connector, session); parser.setMaxFrameLength(getMaxFrameLength()); parser.setMaxSettingsKeys(getMaxSettingsKeys()); HTTP2Connection connection = new HTTP2ServerConnection(connector.getByteBufferPool(), connector.getExecutor(), endPoint, httpConfiguration, parser, session, getInputBufferSize(), listener); connection.addListener(sessionContainer); return configure(connection, connector, endPoint); }