diff options
-rw-r--r-- | capture.c | 7 | ||||
-rw-r--r-- | file.h | 1 | ||||
-rw-r--r-- | gtk/main.c | 33 |
3 files changed, 29 insertions, 12 deletions
@@ -98,6 +98,13 @@ capture_start(capture_options *capture_opts) } capture_opts->state = CAPTURE_STOPPED; + } else { + /* the capture child might not respond shortly after bringing it up */ + /* (especially it will block, if no input coming from an input capture pipe (e.g. mkfifo) is coming in) */ + + /* to prevent problems, bring the main GUI into "capture mode" right after successfully */ + /* spawn/exec the capture child, without waiting for any response from it */ + cf_callback_invoke(cf_cb_live_capture_prepared, capture_opts); } return ret; @@ -60,6 +60,7 @@ typedef enum { cf_cb_file_read_start, cf_cb_file_read_finished, #ifdef HAVE_LIBPCAP + cf_cb_live_capture_prepared, cf_cb_live_capture_update_started, cf_cb_live_capture_update_continue, cf_cb_live_capture_update_finished, diff --git a/gtk/main.c b/gtk/main.c index 21b838de79..f23ba89352 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1289,9 +1289,8 @@ main_cf_cb_file_read_finished(capture_file *cf) #ifdef HAVE_LIBPCAP static void -main_cf_cb_live_capture_update_started(capture_options *capture_opts) +main_cf_cb_live_capture_prepared(capture_options *capture_opts) { - gchar *capture_msg; gchar *title; @@ -1308,10 +1307,25 @@ main_cf_cb_live_capture_update_started(capture_options *capture_opts) a capture. */ set_menus_for_capture_in_progress(TRUE); + /* update statusbar */ + statusbar_push_file_msg("Waiting for capture input data ..."); + + /* Don't set up main window for a capture file. */ + main_set_for_capture_file(FALSE); +} + +static void +main_cf_cb_live_capture_update_started(capture_options *capture_opts) +{ + gchar *capture_msg; + + /* Enable menu items that make sense if you have some captured packets (yes, I know, we don't have any *yet*). */ set_menus_for_captured_packets(TRUE); + statusbar_pop_file_msg(); + capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s", get_interface_descriptive_name(capture_opts->iface), (capture_opts->save_file) ? capture_opts->save_file : ""); @@ -1377,22 +1391,14 @@ static void main_cf_cb_live_capture_fixed_started(capture_options *capture_opts) { gchar *capture_msg; - gchar *title; - title = g_strdup_printf("%s: Capturing - Ethereal", - get_interface_descriptive_name(capture_opts->iface)); - set_main_window_name(title); - g_free(title); - - /* Disable menu items that make no sense if you're currently running - a capture. */ - set_menus_for_capture_in_progress(TRUE); - /* Enable menu items that make sense if you have some captured packets (yes, I know, we don't have any *yet*). */ /*set_menus_for_captured_packets(TRUE);*/ + statusbar_pop_file_msg(); + capture_msg = g_strdup_printf(" %s: <live capture in progress> to file: %s", get_interface_descriptive_name(capture_opts->iface), (capture_opts->save_file) ? capture_opts->save_file : ""); @@ -1505,6 +1511,9 @@ void main_cf_callback(gint event, gpointer data, gpointer user_data _U_) main_cf_cb_file_read_finished(data); break; #ifdef HAVE_LIBPCAP + case(cf_cb_live_capture_prepared): + main_cf_cb_live_capture_prepared(data); + break; case(cf_cb_live_capture_update_started): main_cf_cb_live_capture_update_started(data); break; |