aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.h
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2022-08-07 12:31:48 +0200
committerTomasz Moń <desowin@gmail.com>2022-08-10 06:18:15 +0200
commitc1861ad1cc5ea673ee373e0cb69bfcd638ef06a2 (patch)
treeb25877413c4bbe462bd0040c9a2a77060308399c /capture_opts.h
parent86c6509cf32ce9350ed20dea4c741052ec65f3dc (diff)
extcap: Close capture session after extcap finishes
Wait up to 30 seconds for extcap process to finish after closing pipes. The wait is achieved in non-blocking fashion, i.e. the UI is completely responsive during the wait. Only actions related to capture process like capture control, file open, save, export are inactive during the wait. On Windows extcap child watch callback gets called immediately as the process is forcefully terminated. Prior to this change the extcap was forcefully terminated on Windows anyway. The wait is possible on UNIX systems if extcap does handle SIGPIPE and SIGTERM signals. The defaults handlers for SIGPIPE and SIGTERM simply terminate the process so for large number of extcaps there is no change. If extcap does not finish within 30 seconds, it is forcefully terminated using SIGKILL signal.
Diffstat (limited to 'capture_opts.h')
-rw-r--r--capture_opts.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/capture_opts.h b/capture_opts.h
index e1d3ff7960..8a29b8299b 100644
--- a/capture_opts.h
+++ b/capture_opts.h
@@ -210,6 +210,7 @@ typedef struct interface_options_tag {
GHashTable *extcap_args;
GPid extcap_pid; /* pid of running process or WS_INVALID_PID */
gpointer extcap_pipedata;
+ gchar *extcap_stderr;
guint extcap_child_watch;
#ifdef _WIN32
HANDLE extcap_pipe_h;
@@ -326,6 +327,8 @@ typedef struct capture_options_tag {
gboolean output_to_pipe; /**< save_file is a pipe (named or stdout) */
gboolean capture_child; /**< hidden option: Wireshark child mode */
gchar *compress_type; /**< compress type */
+ gchar *closed_msg; /**< Dumpcap capture closed message */
+ guint extcap_terminate_id; /**< extcap process termination source ID */
} capture_options;
/* initialize the capture_options with some reasonable values */