diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-04-29 17:54:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-04-29 17:54:46 +0000 |
commit | 25e8c37489cf6503e7ce8c436f19f54bf7a5027a (patch) | |
tree | dcbe91c747f03f35df391a14e4fdf728623dbffe /capture_loop.c | |
parent | f3d1963924c0b88d7a47c983f3bc3d98273a9e7b (diff) |
Have the ring buffer routines take a pointer to a "bytes written" count
as an argument, rather than keeping the count to themselves, so the
count kept by the capturing program can be updated correctly - including
getting reset when files are switched. Fixes bug 895.
svn path=/trunk/; revision=18032
Diffstat (limited to 'capture_loop.c')
-rw-r--r-- | capture_loop.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/capture_loop.c b/capture_loop.c index f4a3f908fa..16d32bb350 100644 --- a/capture_loop.c +++ b/capture_loop.c @@ -744,7 +744,8 @@ gboolean capture_loop_init_output(capture_options *capture_opts, int save_file_f /* Set up to write to the capture file. */ if (capture_opts->multi_files_on) { - ld->pdh = ringbuf_init_libpcap_fdopen(ld->linktype, file_snaplen, &err); + ld->pdh = ringbuf_init_libpcap_fdopen(ld->linktype, file_snaplen, + &ld->bytes_written, &err); } else { ld->pdh = libpcap_fdopen(save_file_fd, ld->linktype, file_snaplen, &ld->bytes_written, &err); @@ -1233,7 +1234,7 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct /* Switch to the next ringbuffer file */ if (ringbuf_switch_file(&ld.pdh, &capture_opts->save_file, - &save_file_fd, &ld.err)) { + &save_file_fd, &ld.bytes_written, &ld.err)) { /* File switch succeeded: reset the conditions */ cnd_reset(cnd_autostop_size); if (cnd_file_duration) { @@ -1303,7 +1304,8 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct } /* Switch to the next ringbuffer file */ - if (ringbuf_switch_file(&ld.pdh, &capture_opts->save_file, &save_file_fd, &ld.err)) { + if (ringbuf_switch_file(&ld.pdh, &capture_opts->save_file, + &save_file_fd, &ld.bytes_written, &ld.err)) { /* file switch succeeded: reset the conditions */ cnd_reset(cnd_file_duration); if(cnd_autostop_size) |