bugfixes: bring non real-time captures back to former behaviour, other minor fixes
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Mar 2005 21:05:53 +0000 (21:05 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 28 Mar 2005 21:05:53 +0000 (21:05 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13961 f5534014-38df-0310-8fa8-9805f1628bb7

capture.c
capture_opts.c
capture_sync.c
file.c
gtk/main.c

index cd5e485ae6f6e828c4ec83d66cb19bbeafe103f9..ed7b7ad4319a343f5002bb18390558622bd3efbf 100644 (file)
--- 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), 
index ac57549b4956d1545f2a30d6145c52c5bdb70efb..64a9b85e25bf16ce7798a6c411e6bb3f2ded128f 100644 (file)
@@ -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);
index 4e2ba36d7b2cc8a6aac7afc85a30578efed7f4f3..513132988d7c65235429b7ee2a72c7bd369229b0 100644 (file)
@@ -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 067e9ca5090118174fccd3a6dcbdd3995239034e..e90ae240a36298bb854c321f87d2def077048de5 100644 (file)
--- 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? */
index 47308d603c502e278945e3d79a3ed72bdfd48e57..c2b4ac908b1ccfb7c2df18e910305089b1ed0eb1 100644 (file)
@@ -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);