Skip to content

Commit 880e79d

Browse files
authored
Issue #13548 - Improved HTTP2Connection dump information (#13591)
Improved HTTP2Session dump information by adding local and remote settings. Signed-off-by: znight1020 <[email protected]> Signed-off-by: 이현수 <[email protected]>
1 parent 7e4a9be commit 880e79d

File tree

1 file changed

+11
-1
lines changed
  • jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2

1 file changed

+11
-1
lines changed

jetty-core/jetty-http2/jetty-http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import org.eclipse.jetty.util.component.AbstractLifeCycle;
7878
import org.eclipse.jetty.util.component.Dumpable;
7979
import org.eclipse.jetty.util.component.DumpableCollection;
80+
import org.eclipse.jetty.util.component.DumpableMap;
8081
import org.eclipse.jetty.util.thread.AutoLock;
8182
import org.eclipse.jetty.util.thread.Invocable;
8283
import org.eclipse.jetty.util.thread.Scheduler;
@@ -91,6 +92,8 @@ public abstract class HTTP2Session extends AbstractLifeCycle implements Session,
9192
private static final int MAX_TOTAL_LOCAL_STREAMS = Integer.MAX_VALUE / 2;
9293

9394
private final Map<Integer, HTTP2Stream> streams = new ConcurrentHashMap<>();
95+
private final Map<Integer, Integer> localSettings = new ConcurrentHashMap<>();
96+
private final Map<Integer, Integer> remoteSettings = new ConcurrentHashMap<>();
9497
private final Set<Integer> priorityStreams = ConcurrentHashMap.newKeySet();
9598
private final List<FrameListener> frameListeners = new CopyOnWriteArrayList<>();
9699
private final List<LifeCycleListener> lifeCycleListeners = new CopyOnWriteArrayList<>();
@@ -445,6 +448,7 @@ public void onSettings(SettingsFrame frame, boolean reply)
445448
return;
446449

447450
Map<Integer, Integer> settings = frame.getSettings();
451+
remoteSettings.putAll(settings);
448452
configure(settings, false);
449453
notifySettings(this, frame);
450454

@@ -811,6 +815,9 @@ public void succeeded(Stream pushed)
811815
@Override
812816
public void settings(SettingsFrame frame, Callback callback)
813817
{
818+
if (!frame.isReply())
819+
localSettings.putAll(frame.getSettings());
820+
814821
control(null, callback, frame);
815822
}
816823

@@ -1442,7 +1449,10 @@ protected static boolean isClientStream(int streamId)
14421449
@Override
14431450
public void dump(Appendable out, String indent) throws IOException
14441451
{
1445-
Dumpable.dumpObjects(out, indent, this, flowControl, flusher, new DumpableCollection("streams", streams.values()));
1452+
DumpableCollection streamsDump = new DumpableCollection("streams", streams.values());
1453+
DumpableMap localSettingsDump = new DumpableMap("local settings", localSettings);
1454+
DumpableMap remoteSettingsDump = new DumpableMap("remote settings", remoteSettings);
1455+
Dumpable.dumpObjects(out, indent, this, flowControl, flusher, streamsDump, localSettingsDump, remoteSettingsDump);
14461456
}
14471457

14481458
@Override

0 commit comments

Comments
 (0)