aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-03-28 21:05:53 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-03-28 21:05:53 +0000
commit0b132c9b1d8dba90d92b3ea3a9ccc010ba40a70e (patch)
tree48a1f3fd3998706aa9221628f162698cf50acaea
parent778c9abaeaa51403c30c017b9a7a870e1135593e (diff)
bugfixes: bring non real-time captures back to former behaviour, other minor fixes
svn path=/trunk/; revision=13961
-rw-r--r--capture.c6
-rw-r--r--capture_opts.c2
-rw-r--r--capture_sync.c2
-rw-r--r--file.c5
-rw-r--r--gtk/main.c6
5 files changed, 13 insertions, 8 deletions
diff --git a/capture.c b/capture.c
index cd5e485ae6..ed7b7ad431 100644
--- a/capture.c
+++ b/capture.c
@@ -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");
}
diff --git a/file.c b/file.c
index 067e9ca509..e90ae240a3 100644
--- a/file.c
+++ b/file.c
@@ -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);