Skip to content
Draft
Show file tree
Hide file tree
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
Expand Up @@ -30,25 +30,6 @@ public class FrameSettingsClient extends com.ibm.ws.http.channel.h2internal.fram

private final ByteBuf frame;

static {
// We discovered an issue with the adaptive allocator using Unsafe being unavailable
// and throwing exceptions which do not allow the tests to proceed due to Java 2 Security.
// Because of this, while this is fixed we will use the pooled allocator as before to
// ensure proper testing
if (System.getSecurityManager() == null) {
System.setProperty("io.netty.allocator.type", "pooled");
}
else {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
System.setProperty("io.netty.allocator.type", "pooled");
return null;
}
});
}
}

/**
*
* @param streamId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2025 IBM Corporation and others.
* Copyright (c) 2004, 2026 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -2285,7 +2285,20 @@ private void nettyInitForwardedValues() {
Matcher matcher = null;

String remoteIp = nettyContext.channel().remoteAddress().toString();
remoteIp = remoteIp.substring(1, remoteIp.indexOf(':'));
// Note: Format changed in Netty 4.2
// Handing updated to work with both formats: "/127.0.0.1:port" and "hostname/127.0.0.1:port"

// If there's a hostname prefix (e.g., "localhost/127.0.0.1:port") or it starts with a forward slash,
// Extract just the IP:Port part
int slashIndex = remoteIp.indexOf('/');
if (slashIndex > 0) {
remoteIp = remoteIp.substring(slashIndex + 1);
}
// Extract IP address before the port
int colonIndex = remoteIp.indexOf(':');
if (colonIndex > 0) {
remoteIp = remoteIp.substring(0, colonIndex);
}

String attribute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ private void setNettySystemProperties() {
// issues are found and leak detection is needed to debug them.
System.setProperty("io.netty.leakDetection.level", "DISABLED");
}
if (System.getProperty("io.netty.allocator.type") == null) {
// On Netty version 4.2, the default allocator changed from pooled to adaptive and so
// as of that moment, the adaptive allocator showed a regression from the pooled allocator
// used in Netty 4.1. We switch to the pooled allocator for the moment until these issues
// are addressed
System.setProperty("io.netty.allocator.type", "pooled");
}
// if (System.getProperty("io.netty.allocator.type") == null) {
// // On Netty version 4.2, the default allocator changed from pooled to adaptive and so
// // as of that moment, the adaptive allocator showed a regression from the pooled allocator
// // used in Netty 4.1. We switch to the pooled allocator for the moment until these issues
// // are addressed
// System.setProperty("io.netty.allocator.type", "pooled");
// }
}

/*
Expand Down