capture: Allow aborting a read with pending packets
commitfbed57a0385f7c0d98a07654e558b18981bfe4fe
authorJohn Thacker <johnthacker@gmail.com>
Mon, 16 Sep 2024 11:50:31 +0000 (16 07:50 -0400)
committerAndersBroman <a.broman58@gmail.com>
Thu, 19 Sep 2024 05:12:09 +0000 (19 05:12 +0000)
tree9be98858fbf55ed245b91384d0d168ae934b1352
parent6bcc3e0bf9bd6631a98072ccd418a366208577b0
capture: Allow aborting a read with pending packets

It's possible in certain cases for dumpcap to have written packets
that haven't been added to the packet list yet. Normally (especially
when saving) we wait for Wireshark to finish processing those packets.

Allow the Qt GUI to set the capture file state to FILE_READ_ABORTED
in cases where we want to close a file without reading the remaining
packets. Note we don't necessarily want to exit the application in
that case; we could be doing this to restart a capture.

This doesn't fully address the case where we're in the middle of
stopping the capture waiting for packets to be added, and the user
has changed their mind and wants to exit now.

Part of #19831
ui/capture.c
ui/qt/wireshark_main_window.cpp
ui/qt/wireshark_main_window.h