diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-08-24 12:30:56 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-08-26 15:04:28 +0000 |
commit | e234ce8804e6d27656d5db332ea521392be7d25f (patch) | |
tree | 3b5a3001b3ea56e40baff5eec7bc4b4e033ec83e /ui/qt/follow_stream_dialog.cpp | |
parent | f7e9a795a8575c8170346e878b898efe1e5be304 (diff) | |
download | wireshark-e234ce8804e6d27656d5db332ea521392be7d25f.tar.gz |
Rework tapping in Qt dialogs.
Add cf_cb_file_retap_started and cf_cb_file_retap_finished to file.[ch].
Add their associated signals to CaptureFile.
Add registerTapListener and removeTapListeners to WiresharkDialog, which
collect and automatically remove tap listeners. Add beginRetapPackets
and endRetapPackets, which can be used to wrap critical sections so that
we don't delete ourselves while tapping. Don't cancel tapping on close
in WiresharkDialog.
Use beginRetapPackets and endRetapPackets in WiresharkDialog and
FollowStreamDialog. We will likely need to add them elsewhere.
Update comments.
Change-Id: I1788a6ade0817c31aa3419216df96be5e36b2178
Reviewed-on: https://code.wireshark.org/review/10261
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/follow_stream_dialog.cpp')
-rw-r--r-- | ui/qt/follow_stream_dialog.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 39655f2203..7fa3947a17 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -841,9 +841,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) follow_stats_t stats; tcp_stream_chunk sc; size_t nchars; - GString * msg; gboolean is_tcp = FALSE, is_udp = FALSE; + beginRetapPackets(); resetStream(); if (file_closed_) @@ -968,13 +968,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) case FOLLOW_UDP: { /* data will be passed via tap callback*/ - msg = register_tap_listener("udp_follow", &follow_info_, - follow_filter.toUtf8().constData(), - 0, NULL, udp_queue_packet_data, NULL); - if (msg) { - QMessageBox::critical(this, "Error", - "Can't register udp_follow tap: %1", - msg->str); + if (!registerTapListener("udp_follow", &follow_info_, + follow_filter.toUtf8().constData(), + 0, NULL, udp_queue_packet_data, NULL)) { return false; } @@ -990,13 +986,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) } case FOLLOW_SSL: /* we got ssl so we can follow */ - msg = register_tap_listener("ssl", &follow_info_, - follow_filter.toUtf8().constData(), 0, - NULL, ssl_queue_packet_data, NULL); - if (msg) - { - QMessageBox::critical(this, "Error", - "Can't register ssl tap: %1", msg->str); + if (!registerTapListener("ssl", &follow_info_, + follow_filter.toUtf8().constData(), 0, + NULL, ssl_queue_packet_data, NULL)) { return false; } break; @@ -1012,10 +1004,8 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) break; case FOLLOW_UDP: - remove_tap_listener(&follow_info_); - break; case FOLLOW_SSL: - remove_tap_listener(&follow_info_); + removeTapListeners(); break; } @@ -1235,6 +1225,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) data_out_file = NULL; } + endRetapPackets(); return true; } |