Skip to content

Commit

Permalink
Remove prefetch #7663 (#7676)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkec authored Sep 27, 2023
1 parent 24fe012 commit 6c56b9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
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

0 comments on commit 6c56b9d

Please sign in to comment.