io.servicetalk.http.netty.H1ProtocolConfig Maven / Gradle / Ivy
Show all versions of servicetalk-http-netty Show documentation
/*
* Copyright © 2019-2020 Apple Inc. and the ServiceTalk project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.servicetalk.http.netty;
import io.servicetalk.http.api.HttpClient;
import io.servicetalk.http.api.HttpProtocolConfig;
/**
* Configuration for HTTP/1.1 protocol.
*
* @see HttpProtocolConfigs#h1Default()
*/
public interface H1ProtocolConfig extends HttpProtocolConfig {
@Override
default String alpnId() {
return AlpnIds.HTTP_1_1;
}
/**
* Maximum number of pipelined HTTP requests to queue up.
*
* Anything above this value will be rejected, {@code 1} means pipelining is disabled and requests/responses are
* processed sequentially.
*
* Note: {@link HttpClient#reserveConnection reserved connections} will not be restricted by this setting.
*
* @return maximum number of pipelined HTTP requests to queue up
*/
int maxPipelinedRequests();
/**
* Maximum length of the HTTP start line for an HTTP
* message.
*
* Note: a decoder will close the connection with {@code TooLongFrameException} if the start line exceeds
* this value.
*
* @return maximum size of the HTTP start line for an
* HTTP message
*/
int maxStartLineLength();
/**
* Maximum length of the HTTP header fields and
* trailer fields to parse.
*
* Note: a decoder will close the connection with {@code TooLongFrameException} if the length of a header or
* trailer field exceeds this value.
*
* @return maximum length of HTTP header fields and
* trailer fields to parse
*/
int maxHeaderFieldLength();
/**
* Value used to calculate an exponential moving average of the encoded size of the HTTP
* start line and
* header fields for a guess for future buffer
* allocations.
*
* @return value used to calculate an exponential moving average of the encoded size of the HTTP
* start line and
* header fields
*/
int headersEncodedSizeEstimate();
/**
* Value used to calculate an exponential moving average of the encoded size of the HTTP
* trailer fields for a guess for future
* buffer allocations.
*
* @return value used to calculate an exponential moving average of the encoded size of the HTTP
* trailer fields
*/
int trailersEncodedSizeEstimate();
/**
* Additional exceptions for HTTP/1.1 specification.
*
* @return exceptions for HTTP/1.1 specification
*/
H1SpecExceptions specExceptions();
}