Example usage for io.vertx.core.http HttpServerOptions setMaxInitialLineLength

List of usage examples for io.vertx.core.http HttpServerOptions setMaxInitialLineLength

Introduction

In this page you can find the example usage for io.vertx.core.http HttpServerOptions setMaxInitialLineLength.

Prototype

public HttpServerOptions setMaxInitialLineLength(int maxInitialLineLength) 

Source Link

Document

Set the maximum length of the initial line for HTTP/1.x (e.g.

Usage

From source file:org.apache.servicecomb.transport.rest.vertx.RestServerVerticle.java

License:Apache License

private HttpServerOptions createDefaultHttpServerOptions() {
    HttpServerOptions serverOptions = new HttpServerOptions();
    serverOptions.setUsePooledBuffers(true);
    serverOptions.setIdleTimeout(TransportConfig.getConnectionIdleTimeoutInSeconds());
    serverOptions.setCompressionSupported(TransportConfig.getCompressed());
    serverOptions.setMaxHeaderSize(TransportConfig.getMaxHeaderSize());
    serverOptions.setMaxInitialLineLength(TransportConfig.getMaxInitialLineLength());
    if (endpointObject.isHttp2Enabled()) {
        serverOptions.setUseAlpn(TransportConfig.getUseAlpn()).setInitialSettings(
                new Http2Settings().setMaxConcurrentStreams(TransportConfig.getMaxConcurrentStreams()));
    }//from   w w  w.  j  ava  2s .  com
    if (endpointObject.isSslEnabled()) {
        SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(SSL_KEY, null);
        SSLOption sslOption;
        if (factory == null) {
            sslOption = SSLOption.buildFromYaml(SSL_KEY);
        } else {
            sslOption = factory.createSSLOption();
        }
        SSLCustom sslCustom = SSLCustom.createSSLCustom(sslOption.getSslCustomClass());
        VertxTLSBuilder.buildNetServerOptions(sslOption, sslCustom, serverOptions);
    }

    return serverOptions;
}