aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-05-25 23:28:59 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-05-25 23:28:59 +0000
commit351214282dba3126faea8ccab2e3310f4ce35cf7 (patch)
tree4f69d9d73ef5eed2db24a06371fd7aa68013162e
parentb3b72959a23905eda7a6cf68c5f531daea63acd5 (diff)
downloadwireshark-351214282dba3126faea8ccab2e3310f4ce35cf7.tar.gz
wireshark-351214282dba3126faea8ccab2e3310f4ce35cf7.tar.bz2
wireshark-351214282dba3126faea8ccab2e3310f4ce35cf7.zip
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 svn path=/trunk/; revision=14436
-rw-r--r--capture.c7
-rw-r--r--file.h1
-rw-r--r--gtk/main.c33
3 files changed, 29 insertions, 12 deletions
diff --git a/capture.c b/capture.c
index db8ff029ef..2d8b23c0a8 100644
--- a/capture.c
+++ b/capture.c
@@ -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;
diff --git a/file.h b/file.h
index 74cc6981b6..ce7b1700cd 100644
--- a/file.h
+++ b/file.h
@@ -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;