Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect name of decoderEnforceMaxRstFramesPerWindow property #2740

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright © 2021-2022 Apple Inc. and the ServiceTalk project authors
* Copyright © 2021-2023 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.
Expand Down Expand Up @@ -44,11 +44,15 @@ final class OptimizedHttp2FrameCodecBuilder extends Http2FrameCodecBuilder {
// Netty. For the next major release we should either remove these properties or promote them to public API.
private static final String MAX_CONSECUTIVE_EMPTY_FRAMES_PROPERTY_NAME =
"io.servicetalk.http.netty.http2.decoderEnforceMaxRstFramesPerWindow.maxConsecutiveEmptyFrames";
private static final String MAX_RST_FRAMES_PER_WINDOW_PROPERTY_NAME =
"io.servicetalk.http.netty.http2.decoderEnforceMaxRstFramesPerWindow.maxRstFramesPerWindow";
private static final String SECONDS_PER_WINDOW_PROPERTY_NAME =
"io.servicetalk.http.netty.http2.decoderEnforceMaxRstFramesPerWindow.secondsPerWindow";

private static final int MAX_CONSECUTIVE_EMPTY_FRAMES;
private static final int SECONDS_PER_WINDOW;
// Default values are taken from Netty's AbstractHttp2ConnectionHandlerBuilder
private static final int MAX_RST_FRAMES_PER_WINDOW = parseProperty(MAX_RST_FRAMES_PER_WINDOW_PROPERTY_NAME,
parseProperty(MAX_CONSECUTIVE_EMPTY_FRAMES_PROPERTY_NAME, 200));
private static final int SECONDS_PER_WINDOW = parseProperty(SECONDS_PER_WINDOW_PROPERTY_NAME, 30);

@Nullable
private static final MethodHandle FLUSH_PREFACE;
Expand All @@ -75,10 +79,6 @@ final class OptimizedHttp2FrameCodecBuilder extends Http2FrameCodecBuilder {
}
FLUSH_PREFACE = flushPreface;

// Default values are taken from Netty's AbstractHttp2ConnectionHandlerBuilder
MAX_CONSECUTIVE_EMPTY_FRAMES = parseProperty(MAX_CONSECUTIVE_EMPTY_FRAMES_PROPERTY_NAME, 200);
SECONDS_PER_WINDOW = parseProperty(SECONDS_PER_WINDOW_PROPERTY_NAME, 30);

MethodHandle decoderEnforceMaxRstFramesPerWindow;
try {
// Find a new method that exists only in Netty starting from 4.1.100.Final:
Expand Down Expand Up @@ -163,7 +163,7 @@ private static Http2FrameCodecBuilder decoderEnforceMaxRstFramesPerWindow(
try {
// invokeExact requires return type cast to match the type signature
return (Http2FrameCodecBuilder) methodHandle.invokeExact(builderInstance,
MAX_CONSECUTIVE_EMPTY_FRAMES, SECONDS_PER_WINDOW);
MAX_RST_FRAMES_PER_WINDOW, SECONDS_PER_WINDOW);
} catch (Throwable t) {
throwException(t);
return builderInstance;
Expand Down
Loading