GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-port 4.1: HTTP2: Ensure HTTP2 preface is always send as first message by netty-project-bot · Pull Request #16642 · netty/netty

Auto-port 4.1: HTTP2: Ensure HTTP2 preface is always send as first message #16642

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.

Sign up for GitHub

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

Merged
normanmaurer merged 4 commits into 4.1 from auto-port-pr-16636-to-4.1
Apr 14, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Auto-port 4.1: HTTP2: Ensure HTTP2 preface is always send as first message #16642

Changes from 1 commit
Commits
Show all changes
4 commits
Select commit Hold shift + click to select a range
efae2bf
HTTP2: Ensure HTTP2 preface is always send as first message (#16636)
normanmaurer Apr 13, 2026
3f46e32
Fix compile error
normanmaurer Apr 14, 2026
2af7f35
Fix compile error
normanmaurer Apr 14, 2026
2894216
Needs to be final
normanmaurer Apr 14, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
Fix compile error
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer
normanmaurer committed Apr 14, 2026
commit 3f46e328f0e047cee08d228ec0c9b20b74945a0a

There are no files selected for viewing

41 changes: 29 additions & 12 deletions 41 codec-http2/src/test/java/io/netty/handler/codec/http2/H2PrefaceTest.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.MultiThreadIoEventLoopGroup;
import io.netty.channel.nio.NioIoHandler;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
Expand Down Expand Up @@ -53,7 +53,7 @@ enum OpenMode {
@EnumSource(OpenMode.class)
void openStreamAfterBlockingConnect(OpenMode mode) throws Exception {
StreamRequestResponseListener streamRequestResponseListener = new StreamRequestResponseListener();
EventLoopGroup eventLoopGroup = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
EventLoopGroup eventLoopGroup = new NioEventLoopGroup();

Channel backend = new ServerBootstrap()
.group(eventLoopGroup)
Expand Down Expand Up @@ -109,13 +109,26 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
streamChannelBootstrap.open().addListener(streamRequestResponseListener);
break;
case Listener:
cf.addListener((ChannelFuture connectFuture) ->
streamChannelBootstrap.open().addListener(streamRequestResponseListener));
cf.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
streamChannelBootstrap.open().addListener(streamRequestResponseListener);
}
});

break;
case SubmitInListener:
cf.addListener(f -> channel.eventLoop().submit(() ->
streamChannelBootstrap.open().addListener(streamRequestResponseListener)
));
cf.addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture future) throws Exception {
channel.eventLoop().submit(new Runnable() {
@Override
public void run() {
streamChannelBootstrap.open().addListener(streamRequestResponseListener);
}
});
}
});
break;
default:
throw new AssertionError();
Expand Down Expand Up @@ -145,7 +158,8 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) {
/// Send a request and wait for a response once an Http2StreamChannel is established
private static final class StreamRequestResponseListener implements
GenericFutureListener<Future<Http2StreamChannel>> {
private final CompletableFuture<Http2HeadersFrame> responseHeaders = new CompletableFuture<>();
private final CompletableFuture<Http2HeadersFrame> responseHeaders =
new CompletableFuture<Http2HeadersFrame>();

@Override
public void operationComplete(final Future<Http2StreamChannel> future) {
Expand All @@ -169,9 +183,12 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
.path("/test")
.scheme("http");
final Http2HeadersFrame headersFrame = new DefaultHttp2HeadersFrame(headers, true);
streamChannel.writeAndFlush(headersFrame).addListener(f -> {
if (!f.isSuccess()) {
responseHeaders.completeExceptionally(f.cause());
streamChannel.writeAndFlush(headersFrame).addListener(new ChannelFutureListener() {
@Override
public void operationComplete(ChannelFuture f) throws Exception {
if (!f.isSuccess()) {
responseHeaders.completeExceptionally(f.cause());
}
}
});
}
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.