Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.
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.
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 @@ -17,31 +17,64 @@

import io.netty.util.collection.LongObjectHashMap;
import io.netty.util.collection.LongObjectMap;
import io.netty.util.internal.ObjectUtil;
import io.netty.util.internal.StringUtil;

import javax.annotation.Nullable;
import java.util.Iterator;
import java.util.Map;

public final class DefaultHttp3SettingsFrame implements Http3SettingsFrame {

private final LongObjectMap<Long> settings = new LongObjectHashMap<>(4);
private final Http3Settings settings;

public DefaultHttp3SettingsFrame(Http3Settings settings) {
this.settings = ObjectUtil.checkNotNull(settings, "settings");
}

public DefaultHttp3SettingsFrame() {
this.settings = new Http3Settings();
}

@Override
public Http3Settings settings() {
return settings;
}

/**
* Get a setting by its key.
*
* @param key the HTTP/3 setting key
* @return the value, or {@code null} if not set
* @deprecated use {@link #settings()} and manipulate the {@link Http3Settings} directly
*/
@Override
@Deprecated
@Nullable
public Long get(long key) {
// Legacy behavior: direct map access.
return settings.get(key);
}

/**
* Set a setting value by key.
*
* @param key the HTTP/3 setting key
* @param value the value to set
* @return the previous value, or {@code null} if none
* @throws IllegalArgumentException if the key is reserved for HTTP/2
* @deprecated use {@link #settings()} and manipulate the {@link Http3Settings} directly
*/
@Override
@Deprecated
@Nullable
public Long put(long key, Long value) {
if (Http3CodecUtils.isReservedHttp2Setting(key)) {
throw new IllegalArgumentException("Setting is reserved for HTTP/2: " + key);
}
return settings.put(key, value);
}

@Override
public Iterator<Map.Entry<Long, Long>> iterator() {
return settings.entrySet().iterator();
return settings.iterator();
}

@Override
Expand Down
Loading
Loading