Capture file retapping fixups.
Add CaptureFile::delayedRetapPackets, which starts retapping after the current batch of UI event are processed. Call it in the constructors of various dialogs so that they are shown before tapping starts. This *might* fix a crash found when following large streams from the Conversations dialog. Change-Id: If1b87491621ab7efcc0519f95891d34dcd9d18c1 Reviewed-on: https://code.wireshark.org/review/9818 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
parent
5b856134f6
commit
a03a43bd32
|
@ -36,6 +36,7 @@ capture_file cfile;
|
||||||
#include "ui/capture.h"
|
#include "ui/capture.h"
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
// To do:
|
// To do:
|
||||||
// - Add getters and (if needed) setters:
|
// - Add getters and (if needed) setters:
|
||||||
|
@ -96,6 +97,11 @@ void CaptureFile::retapPackets()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CaptureFile::delayedRetapPackets()
|
||||||
|
{
|
||||||
|
QTimer::singleShot(0, this, SLOT(retapPackets()));
|
||||||
|
}
|
||||||
|
|
||||||
void CaptureFile::reload()
|
void CaptureFile::reload()
|
||||||
{
|
{
|
||||||
if (cap_file_ && cap_file_->state == FILE_READ_DONE) {
|
if (cap_file_ && cap_file_->state == FILE_READ_DONE) {
|
||||||
|
|
|
@ -68,10 +68,6 @@ public:
|
||||||
*/
|
*/
|
||||||
const QString fileName();
|
const QString fileName();
|
||||||
|
|
||||||
/** Retap the capture file
|
|
||||||
*/
|
|
||||||
void retapPackets();
|
|
||||||
|
|
||||||
/** Re;load the capture file
|
/** Re;load the capture file
|
||||||
*/
|
*/
|
||||||
void reload();
|
void reload();
|
||||||
|
@ -107,11 +103,26 @@ signals:
|
||||||
void captureCaptureFailed(capture_session *cap_session);
|
void captureCaptureFailed(capture_session *cap_session);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
/** Retap the capture file. Convenience wrapper for cf_retap_packets.
|
||||||
|
* Application events are processed periodically via update_progress_dlg.
|
||||||
|
*/
|
||||||
|
void retapPackets();
|
||||||
|
|
||||||
|
/** Retap the capture file after the current batch of application events
|
||||||
|
* is processed. If you call this instead of retapPackets or
|
||||||
|
* cf_retap_packets in a dialog's constructor it will be displayed before
|
||||||
|
* tapping starts.
|
||||||
|
*/
|
||||||
|
void delayedRetapPackets();
|
||||||
|
|
||||||
/** Cancel any tapping that might be in progress.
|
/** Cancel any tapping that might be in progress.
|
||||||
*/
|
*/
|
||||||
void stopLoading();
|
void stopLoading();
|
||||||
|
|
||||||
// XXX Not used.
|
/** Sets the capture file's "stop_flag" member.
|
||||||
|
*
|
||||||
|
* @param stop_flag If true, stops the current capture file operation.
|
||||||
|
*/
|
||||||
void setCaptureStopFlag(bool stop_flag = true);
|
void setCaptureStopFlag(bool stop_flag = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -98,7 +98,7 @@ ConversationDialog::ConversationDialog(QWidget &parent, CaptureFile &cf, int cli
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
itemSelectionChanged();
|
itemSelectionChanged();
|
||||||
|
|
||||||
cap_file_.retapPackets();
|
cap_file_.delayedRetapPackets();
|
||||||
}
|
}
|
||||||
|
|
||||||
ConversationDialog::~ConversationDialog()
|
ConversationDialog::~ConversationDialog()
|
||||||
|
@ -228,7 +228,7 @@ void ConversationDialog::followStream()
|
||||||
}
|
}
|
||||||
|
|
||||||
emit filterAction(filter, FilterAction::ActionApply, FilterAction::ActionTypePlain);
|
emit filterAction(filter, FilterAction::ActionApply, FilterAction::ActionTypePlain);
|
||||||
openFollowStreamDialog(ftype);
|
emit openFollowStreamDialog(ftype);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConversationDialog::graphTcp()
|
void ConversationDialog::graphTcp()
|
||||||
|
|
|
@ -85,7 +85,7 @@ EndpointDialog::EndpointDialog(QWidget &parent, CaptureFile &cf, int cli_proto_i
|
||||||
#endif
|
#endif
|
||||||
itemSelectionChanged();
|
itemSelectionChanged();
|
||||||
|
|
||||||
cap_file_.retapPackets();
|
cap_file_.delayedRetapPackets();
|
||||||
}
|
}
|
||||||
|
|
||||||
EndpointDialog::~EndpointDialog()
|
EndpointDialog::~EndpointDialog()
|
||||||
|
|
|
@ -2528,8 +2528,8 @@ void MainWindow::openFollowStreamDialog(follow_type_t type) {
|
||||||
connect(fsd, SIGNAL(updateFilter(QString&, bool)), this, SLOT(filterPackets(QString&, bool)));
|
connect(fsd, SIGNAL(updateFilter(QString&, bool)), this, SLOT(filterPackets(QString&, bool)));
|
||||||
connect(fsd, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
|
connect(fsd, SIGNAL(goToPacket(int)), packet_list_, SLOT(goToPacket(int)));
|
||||||
|
|
||||||
fsd->follow(getFilter());
|
|
||||||
fsd->show();
|
fsd->show();
|
||||||
|
fsd->follow(getFilter());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionAnalyzeFollowTCPStream_triggered()
|
void MainWindow::on_actionAnalyzeFollowTCPStream_triggered()
|
||||||
|
|
|
@ -262,7 +262,7 @@ void ResponseTimeDelayDialog::fillTree()
|
||||||
|
|
||||||
statsTreeWidget()->setSortingEnabled(false);
|
statsTreeWidget()->setSortingEnabled(false);
|
||||||
|
|
||||||
cf_retap_packets(cap_file_.capFile());
|
cap_file_.retapPackets();
|
||||||
|
|
||||||
tapDraw(&rtd_data);
|
tapDraw(&rtd_data);
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ void ServiceResponseTimeDialog::fillTree()
|
||||||
|
|
||||||
statsTreeWidget()->setSortingEnabled(false);
|
statsTreeWidget()->setSortingEnabled(false);
|
||||||
|
|
||||||
cf_retap_packets(cap_file_.capFile());
|
cap_file_.retapPackets();
|
||||||
|
|
||||||
// We only have one table. Move its tree items up one level.
|
// We only have one table. Move its tree items up one level.
|
||||||
if (statsTreeWidget()->invisibleRootItem()->childCount() == 1) {
|
if (statsTreeWidget()->invisibleRootItem()->childCount() == 1) {
|
||||||
|
|
|
@ -261,7 +261,7 @@ void SimpleStatisticsDialog::fillTree()
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
cf_retap_packets(cap_file_.capFile());
|
cap_file_.retapPackets();
|
||||||
|
|
||||||
tapDraw(&stat_data);
|
tapDraw(&stat_data);
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flow
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
|
|
||||||
tapinfo_.session = cap_file_.capFile()->epan;
|
tapinfo_.session = cap_file_.capFile()->epan;
|
||||||
cap_file_.retapPackets();
|
cap_file_.delayedRetapPackets();
|
||||||
}
|
}
|
||||||
|
|
||||||
VoipCallsDialog::~VoipCallsDialog()
|
VoipCallsDialog::~VoipCallsDialog()
|
||||||
|
|
Loading…
Reference in New Issue