diff options
-rw-r--r-- | capture.c | 6 | ||||
-rw-r--r-- | capture_opts.c | 2 | ||||
-rw-r--r-- | capture_sync.c | 2 | ||||
-rw-r--r-- | file.c | 5 | ||||
-rw-r--r-- | gtk/main.c | 6 |
5 files changed, 13 insertions, 8 deletions
@@ -221,6 +221,9 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) return FALSE; break; } + + /* XXX - currently won't work with non real-time mode */ + cf_callback_invoke(cf_cb_live_capture_started, capture_opts->cf); } return TRUE; @@ -292,6 +295,9 @@ capture_input_closed(capture_options *capture_opts) we registered get called. */ main_window_quit(); } + + cf_callback_invoke(cf_cb_live_capture_finished, capture_opts->cf); + } else { /* this is a normal mode capture, read in the capture file data */ capture_input_read_all(capture_opts, cf_is_tempfile(capture_opts->cf), diff --git a/capture_opts.c b/capture_opts.c index ac57549b49..64a9b85e25 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -97,7 +97,7 @@ capture_opts_info(capture_options *capture_opts) { g_warning("SnapLen (%u): %u", capture_opts->has_snaplen, capture_opts->snaplen); g_warning("Promisc : %u", capture_opts->promisc_mode); g_warning("LinkType : %d", capture_opts->linktype); - g_warning("SaveFile : %s", capture_opts->save_file); + g_warning("SaveFile : %s", (capture_opts->save_file) ? capture_opts->save_file : ""); g_warning("RealTimeMode : %u", capture_opts->real_time_mode); g_warning("ShowInfo : %u", capture_opts->show_info); g_warning("QuitAfterCap : %u", capture_opts->quit_after_cap); diff --git a/capture_sync.c b/capture_sync.c index 4e2ba36d7b..513132988d 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -324,7 +324,7 @@ sync_pipe_do_capture(capture_options *capture_opts, gboolean is_tempfile) { argv = sync_pipe_add_arg(argv, &argc, sautostop_duration); } - if (!capture_opts->show_info) { + if (!capture_opts->show_info && capture_opts->real_time_mode /* XXX */) { argv = sync_pipe_add_arg(argv, &argc, "-H"); } @@ -503,9 +503,6 @@ cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempfile, int *er cf_status_t cf_status; cf_status = cf_open(cf, fname, is_tempfile, err); - if (cf_status == CF_OK) { - cf_callback_invoke(cf_cb_live_capture_started, cf); - } return cf_status; } @@ -612,8 +609,6 @@ cf_finish_tail(capture_file *cf, int *err) WTAP_ENCAP_PER_PACKET). */ cf->lnk_t = wtap_file_encap(cf->wth); - cf_callback_invoke(cf_cb_live_capture_finished, cf); - if (*err != 0) { /* We got an error reading the capture file. XXX - pop up a dialog box? */ diff --git a/gtk/main.c b/gtk/main.c index 47308d603c..c2b4ac908b 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1326,7 +1326,11 @@ main_cf_cb_live_capture_started(capture_options *capture_opts) packets (yes, I know, we don't have any *yet*). */ set_menus_for_captured_packets(TRUE); - capture_msg = g_strdup_printf(" %s: <live capture in progress>", get_interface_descriptive_name(capture_opts->iface)); + if(capture_opts->iface) { + capture_msg = g_strdup_printf(" %s: <live capture in progress>", get_interface_descriptive_name(capture_opts->iface)); + } else { + capture_msg = g_strdup_printf(" <live capture in progress>"); + } statusbar_push_file_msg(capture_msg); |