aboutsummaryrefslogtreecommitdiffstats
path: root/capture_loop.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-28 00:19:02 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-28 00:19:02 +0000
commit1c7cca1f7d057fed12608439be600dbdec5abaf9 (patch)
tree90a04c9ab245c6b9b41edef1b1924368de92d42e /capture_loop.c
parent929e3c87c5eee548a6afda26d37247e0c0e40dec (diff)
major capture engine rework: use two task model for EVERY capture mode
rework of the -b command line parameter (for Ethereal and Tethereal) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13949 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_loop.c')
-rw-r--r--capture_loop.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/capture_loop.c b/capture_loop.c
index 1f947fa6f1..32771d5c04 100644
--- a/capture_loop.c
+++ b/capture_loop.c
@@ -1027,6 +1027,26 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
/* We haven't yet gotten the capture statistics. */
*stats_known = FALSE;
+ /*g_warning("capture_loop_start");
+ capture_opts_info(capture_opts);*/
+
+ /*_asm {int 3};*/
+
+ if (capture_opts->multi_files_on) {
+ /* ringbuffer is enabled */
+ capture_opts->save_file_fd = ringbuf_init(capture_opts->save_file,
+ (capture_opts->has_ring_num_files) ? capture_opts->ring_num_files : 0);
+ if (capture_opts->save_file_fd == -1) {
+ ringbuf_error_cleanup();
+ goto error;
+ }
+
+ /* replace save_file by current ringbuffer filename */
+ if(capture_opts->save_file) {
+ g_free(capture_opts->save_file);
+ }
+ capture_opts->save_file = g_strdup(ringbuf_current_filename());
+ }
/* open the "input file" from network interface or capture pipe */
if (!capture_loop_open_input(capture_opts, &ld, errmsg, sizeof(errmsg))) {
@@ -1123,6 +1143,9 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
if (cnd_file_duration) {
cnd_reset(cnd_file_duration);
}
+ if (capture_opts->capture_child) {
+ sync_pipe_filename_to_parent(capture_opts->save_file);
+ }
} else {
/* File switch failed: stop here */
ld.go = FALSE;
@@ -1191,6 +1214,9 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
cnd_reset(cnd_file_duration);
if(cnd_autostop_size)
cnd_reset(cnd_autostop_size);
+ if (capture_opts->capture_child) {
+ sync_pipe_filename_to_parent(capture_opts->save_file);
+ }
} else {
/* File switch failed: stop here */
ld.go = FALSE;