diff --git a/servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpHeadersFactory.java b/servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpHeadersFactory.java index 37523168f5..2ede92ae15 100644 --- a/servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpHeadersFactory.java +++ b/servicetalk-http-api/src/main/java/io/servicetalk/http/api/DefaultHttpHeadersFactory.java @@ -1,5 +1,5 @@ /* - * Copyright © 2018 Apple Inc. and the ServiceTalk project authors + * Copyright © 2018-2019, 2021-2022 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. @@ -85,4 +85,15 @@ public boolean validateCookies() { public boolean validateValues() { return validateValues; } + + @Override + public String toString() { + return getClass().getSimpleName() + + "{validateNames=" + validateNames + + ", validateCookies=" + validateCookies + + ", validateValues=" + validateValues + + ", headersArraySizeHint=" + headersArraySizeHint + + ", trailersArraySizeHint=" + trailersArraySizeHint + + '}'; + } } diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultKeepAlivePolicy.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultKeepAlivePolicy.java index 71f3c65c8a..dfecdf3c3d 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultKeepAlivePolicy.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultKeepAlivePolicy.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Apple Inc. and the ServiceTalk project authors + * Copyright © 2020, 2022 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. @@ -46,4 +46,13 @@ public Duration ackTimeout() { public boolean withoutActiveStreams() { return withoutActiveStreams; } + + @Override + public String toString() { + return getClass().getSimpleName() + + "{idleDuration=" + idleDuration + + ", ackTimeout=" + ackTimeout + + ", withoutActiveStreams=" + withoutActiveStreams + + '}'; + } } diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1ProtocolConfigBuilder.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1ProtocolConfigBuilder.java index 4c430062fc..028cbfb876 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1ProtocolConfigBuilder.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1ProtocolConfigBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019-2020 Apple Inc. and the ServiceTalk project authors + * Copyright © 2019-2020, 2022 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. @@ -211,5 +211,19 @@ public int trailersEncodedSizeEstimate() { public H1SpecExceptions specExceptions() { return specExceptions; } + + @Override + public String toString() { + return getClass().getSimpleName() + + "{alpnId=" + alpnId() + + ", headersFactory=" + headersFactory + + ", maxPipelinedRequests=" + maxPipelinedRequests + + ", maxStartLineLength=" + maxStartLineLength + + ", maxHeaderFieldLength=" + maxHeaderFieldLength + + ", headersEncodedSizeEstimate=" + headersEncodedSizeEstimate + + ", trailersEncodedSizeEstimate=" + trailersEncodedSizeEstimate + + ", specExceptions=" + specExceptions + + '}'; + } } } diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1SpecExceptions.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1SpecExceptions.java index 4e451ab8fb..da1b05d9a0 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1SpecExceptions.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H1SpecExceptions.java @@ -1,5 +1,5 @@ /* - * Copyright © 2020 Apple Inc. and the ServiceTalk project authors + * Copyright © 2020-2022 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. @@ -54,6 +54,14 @@ public boolean allowLFWithoutCR() { return allowLFWithoutCR; } + @Override + public String toString() { + return getClass().getSimpleName() + + "{allowPrematureClosureBeforePayloadBody=" + allowPrematureClosureBeforePayloadBody + + ", allowLFWithoutCR=" + allowLFWithoutCR + + '}'; + } + /** * Builder for {@link H1SpecExceptions}. */ diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2HeadersFactory.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2HeadersFactory.java index 50d1805f9c..808518a5cf 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2HeadersFactory.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2HeadersFactory.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Apple Inc. and the ServiceTalk project authors + * Copyright © 2019, 2021-2022 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. @@ -20,8 +20,6 @@ import io.netty.handler.codec.http2.DefaultHttp2Headers; -import java.util.function.BiPredicate; - /** * A {@link HttpHeadersFactory} optimized for HTTP/2. */ @@ -30,8 +28,6 @@ public final class H2HeadersFactory implements HttpHeadersFactory { private static final boolean DEFAULT_VALIDATE_VALUES = false; public static final HttpHeadersFactory INSTANCE = new H2HeadersFactory(true, true, DEFAULT_VALIDATE_VALUES); - static final BiPredicate DEFAULT_SENSITIVITY_DETECTOR = (name, value) -> false; - private final boolean validateNames; private final boolean validateCookies; private final boolean validateValues; @@ -96,4 +92,15 @@ public boolean validateCookies() { public boolean validateValues() { return validateValues; } + + @Override + public String toString() { + return getClass().getSimpleName() + + "{validateNames=" + validateNames + + ", validateCookies=" + validateCookies + + ", validateValues=" + validateValues + + ", headersArraySizeHint=" + headersArraySizeHint + + ", trailersArraySizeHint=" + trailersArraySizeHint + + '}'; + } } diff --git a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2ProtocolConfigBuilder.java b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2ProtocolConfigBuilder.java index fd3fc03f93..d9b4b2f45f 100644 --- a/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2ProtocolConfigBuilder.java +++ b/servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/H2ProtocolConfigBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Apple Inc. and the ServiceTalk project authors + * Copyright © 2019-2022 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. @@ -26,7 +26,6 @@ import java.util.function.BooleanSupplier; import javax.annotation.Nullable; -import static io.servicetalk.http.netty.H2HeadersFactory.DEFAULT_SENSITIVITY_DETECTOR; import static io.servicetalk.http.netty.H2KeepAlivePolicies.DISABLE_KEEP_ALIVE; import static java.util.Objects.requireNonNull; @@ -37,6 +36,8 @@ */ public final class H2ProtocolConfigBuilder { + private static final BiPredicate DEFAULT_SENSITIVITY_DETECTOR = (name, value) -> false; + private HttpHeadersFactory headersFactory = H2HeadersFactory.INSTANCE; private BiPredicate headersSensitivityDetector = DEFAULT_SENSITIVITY_DETECTOR; @Nullable @@ -152,5 +153,17 @@ public UserDataLoggerConfig frameLoggerConfig() { public KeepAlivePolicy keepAlivePolicy() { return keepAlivePolicy; } + + @Override + public String toString() { + return getClass().getSimpleName() + + "{alpnId=" + alpnId() + + ", headersFactory=" + headersFactory + + ", headersSensitivityDetector=" + (headersSensitivityDetector == DEFAULT_SENSITIVITY_DETECTOR ? + "DEFAULT_SENSITIVITY_DETECTOR" : headersSensitivityDetector.toString()) + + ", frameLoggerConfig=" + frameLoggerConfig + + ", keepAlivePolicy=" + keepAlivePolicy + + '}'; + } } }