forked from osmocom/wireshark
Follow: Remove use of follow type from FollowStreamDialog
We can check if we have a follower. follow_type_t is still used in the constructor, for now, since other parts call it.
This commit is contained in:
parent
2ab291b3b2
commit
38fbccd33e
|
@ -69,7 +69,6 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_
|
||||||
WiresharkDialog(parent, cf),
|
WiresharkDialog(parent, cf),
|
||||||
ui(new Ui::FollowStreamDialog),
|
ui(new Ui::FollowStreamDialog),
|
||||||
b_find_(NULL),
|
b_find_(NULL),
|
||||||
follow_type_(type),
|
|
||||||
follower_(NULL),
|
follower_(NULL),
|
||||||
show_type_(SHOW_ASCII),
|
show_type_(SHOW_ASCII),
|
||||||
truncated_(false),
|
truncated_(false),
|
||||||
|
@ -578,24 +577,11 @@ FollowStreamDialog::readStream()
|
||||||
last_packet_ = 0;
|
last_packet_ = 0;
|
||||||
turns_ = 0;
|
turns_ = 0;
|
||||||
|
|
||||||
switch(follow_type_) {
|
if (follower_) {
|
||||||
|
|
||||||
case FOLLOW_TCP :
|
|
||||||
case FOLLOW_UDP :
|
|
||||||
case FOLLOW_DCCP :
|
|
||||||
case FOLLOW_HTTP :
|
|
||||||
case FOLLOW_HTTP2:
|
|
||||||
case FOLLOW_QUIC:
|
|
||||||
case FOLLOW_TLS :
|
|
||||||
case FOLLOW_SIP :
|
|
||||||
case FOLLOW_WEBSOCKET :
|
|
||||||
ret = readFollowStream();
|
ret = readFollowStream();
|
||||||
break;
|
} else {
|
||||||
|
|
||||||
default :
|
|
||||||
ret = (frs_return_t)0;
|
ret = (frs_return_t)0;
|
||||||
ws_assert_not_reached();
|
ws_assert_not_reached();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->teStreamContent->moveCursor(QTextCursor::Start);
|
ui->teStreamContent->moveCursor(QTextCursor::Start);
|
||||||
|
@ -993,19 +979,13 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index,
|
||||||
follow_filter = gchar_free_to_qstring(get_follow_conv_func(follower_)(cap_file_.capFile()->edt, &cap_file_.capFile()->edt->pi, &stream_num, &sub_stream_num));
|
follow_filter = gchar_free_to_qstring(get_follow_conv_func(follower_)(cap_file_.capFile()->edt, &cap_file_.capFile()->edt->pi, &stream_num, &sub_stream_num));
|
||||||
}
|
}
|
||||||
if (follow_filter.isEmpty()) {
|
if (follow_filter.isEmpty()) {
|
||||||
if (follow_type_ == FOLLOW_QUIC) {
|
// XXX: This error probably has to do with tunneling (#18231), where
|
||||||
QMessageBox::warning(this,
|
// the addresses or ports changed after the TCP or UDP layer.
|
||||||
tr("Error creating filter for this stream."),
|
// (The appropriate layer must be present, or else the GUI
|
||||||
tr("QUIC streams not found on the selected packet."));
|
// doesn't allow the option to be selected.)
|
||||||
} else {
|
QMessageBox::warning(this,
|
||||||
// XXX: This error probably has to do with tunneling, where
|
tr("Error creating filter for this stream."),
|
||||||
// the addresses or ports changed after the TCP or UDP layer.
|
tr("%1 stream not found on the selected packet.").arg(proto_get_protocol_short_name(find_protocol_by_id(get_follow_proto_id(follower_)))));
|
||||||
// (The appropriate layer must be present, or else the GUI
|
|
||||||
// doesn't allow the option to be selected.)
|
|
||||||
QMessageBox::warning(this,
|
|
||||||
tr("Error creating filter for this stream."),
|
|
||||||
tr("A transport or network layer header is needed."));
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,6 @@ private:
|
||||||
QPushButton *b_save_;
|
QPushButton *b_save_;
|
||||||
QPushButton *b_back_;
|
QPushButton *b_back_;
|
||||||
|
|
||||||
follow_type_t follow_type_;
|
|
||||||
follow_info_t follow_info_;
|
follow_info_t follow_info_;
|
||||||
register_follow_t* follower_;
|
register_follow_t* follower_;
|
||||||
show_type_t show_type_;
|
show_type_t show_type_;
|
||||||
|
|
Loading…
Reference in New Issue