aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2021-10-01 22:32:24 -0400
committerJohn Thacker <johnthacker@gmail.com>2021-10-01 22:32:24 -0400
commitced4f00447234c13477a738f8e42b2f262b1065b (patch)
treef6b2fbf487b21fd29f41ef510cb715f311474df3 /ui
parentcfc3212ae2f37f9fec73ccd0a3860f1f5ad018b5 (diff)
UI: Fix "Follow Stream" spin box for protocols without substreams
If the substream spin box is not visible, then we don't need to go looking for a new substream value. Fix #17624
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/follow_stream_dialog.cpp40
1 files changed, 22 insertions, 18 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index d52571b9f6..d909728ab3 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -403,28 +403,32 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num)
sub_stream_num = ui->subStreamNumberSpinBox->value();
ui->subStreamNumberSpinBox->blockSignals(false);
- /* We need to find a suitable sub stream for the new stream */
- guint sub_stream_num_new = static_cast<guint>(sub_stream_num);
gboolean ok;
- if (sub_stream_num < 0) {
- // Stream ID 0 should always exist as it is used for control messages.
- sub_stream_num_new = 0;
- ok = TRUE;
- } else if (follow_type_ == FOLLOW_HTTP2) {
- ok = http2_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
- if (!ok) {
- ok = http2_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
- }
- } else if (follow_type_ == FOLLOW_QUIC) {
- ok = quic_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
- if (!ok) {
- ok = quic_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ if (ui->subStreamNumberSpinBox->isVisible()) {
+ /* We need to find a suitable sub stream for the new stream */
+ guint sub_stream_num_new = static_cast<guint>(sub_stream_num);
+ if (sub_stream_num < 0) {
+ // Stream ID 0 should always exist as it is used for control messages.
+ sub_stream_num_new = 0;
+ ok = TRUE;
+ } else if (follow_type_ == FOLLOW_HTTP2) {
+ ok = http2_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ if (!ok) {
+ ok = http2_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ }
+ } else if (follow_type_ == FOLLOW_QUIC) {
+ ok = quic_get_stream_id_ge(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ if (!ok) {
+ ok = quic_get_stream_id_le(static_cast<guint>(stream_num), sub_stream_num_new, &sub_stream_num_new);
+ }
+ } else {
+ // Should not happen, this field is only visible for suitable protocols.
+ return;
}
+ sub_stream_num = static_cast<gint>(sub_stream_num_new);
} else {
- // Should not happen, this field is only visible for suitable protocols.
- return;
+ ok = true;
}
- sub_stream_num = static_cast<gint>(sub_stream_num_new);
if (stream_num >= 0 && ok) {
follow(previous_filter_, true, stream_num, sub_stream_num);