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

4.x: Remove prefetch #7663 #7676

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ private void sendPreface(Http2ClientProtocolConfig config, boolean sendSettings)
sendListener.frame(ctx, 0, http2Settings);
writer.write(frameData);
}
// First connection window update, with prefetch increment
Http2WindowUpdate windowUpdate = new Http2WindowUpdate(config.prefetch());
Http2Flag.NoFlags flags = Http2Flag.NoFlags.create();
Http2FrameData frameData = windowUpdate.toFrameData(null, 0, flags);
sendListener.frameHeader(ctx, 0, frameData.header());
sendListener.frame(ctx, 0, windowUpdate);
writer.write(frameData);
// Initial window size for connection is not configurable, subsequent update win update is needed
int connectionWinSizeUpd = config.initialWindowSize() - WindowSize.DEFAULT_WIN_SIZE;
if (connectionWinSizeUpd > 0) {
Http2WindowUpdate windowUpdate = new Http2WindowUpdate(connectionWinSizeUpd);
Http2FrameData frameData = windowUpdate.toFrameData(null, 0, Http2Flag.NoFlags.create());
sendListener.frameHeader(ctx, 0, frameData.header());
sendListener.frame(ctx, 0, windowUpdate);
writer.write(frameData);
}
}

private void start(Http2ClientProtocolConfig protocolConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,6 @@ default String type() {
@ConfiguredOption("65535")
int initialWindowSize();

/**
* First connection window update increment sent right after the connection is established.
* Defaults to {@code 33_554_432}.
*
* @return number of bytes the client is prepared to receive as data from all the streams combined
*/
@ConfiguredOption("33554432")
int prefetch();

/**
* Timeout for blocking between windows size check iterations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ static void beforeAll() throws ExecutionException, InterruptedException, Timeout

client = Http2Client.builder()
.baseUri("http://localhost:" + server.actualPort() + "/")
.protocolConfig(it -> it.prefetch(10000))
.build();
}

Expand Down