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 /tethereal.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 'tethereal.c')
-rw-r--r-- | tethereal.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tethereal.c b/tethereal.c index b2fb7a0913..ece0213094 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1716,7 +1716,9 @@ capture(void) its maximum size. */ if (capture_opts.multi_files_on) { /* Switch to the next ringbuffer file */ - if (ringbuf_switch_file(&ld.pdh, &capture_opts.save_file, &save_file_fd, &loop_err)) { + if (ringbuf_switch_file(&ld.pdh, &capture_opts.save_file, + &save_file_fd, &ld.bytes_written, + &loop_err)) { /* File switch succeeded: reset the condition */ cnd_reset(cnd_autostop_size); if (cnd_file_duration) { @@ -1889,7 +1891,8 @@ capture_pcap_cb(u_char *user, const struct pcap_pkthdr *phdr, */ if (cnd_file_duration != NULL && cnd_eval(cnd_file_duration)) { /* time elapsed for this ring file, switch to the next */ - if (ringbuf_switch_file(&ld->pdh, &ld->save_file, &save_file_fd, &loop_err)) { + if (ringbuf_switch_file(&ld->pdh, &ld->save_file, &save_file_fd, + &ld->bytes_written, &loop_err)) { /* File switch succeeded: reset the condition */ cnd_reset(cnd_file_duration); } else { |