From 89599bbb9b4be824e362dbc3f63823561a864eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=BCxen?= Date: Thu, 19 May 2011 04:56:04 +0000 Subject: Fix the capture info dialog. Reset the EOF state such that the number get actually updated. svn path=/trunk/; revision=37279 --- capture_info.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'capture_info.c') diff --git a/capture_info.c b/capture_info.c index 7fe86bbf8d..0856cee2f6 100644 --- a/capture_info.c +++ b/capture_info.c @@ -246,16 +246,19 @@ void capture_info_new_packets(int to_read) /*g_warning("new packets: %u", to_read);*/ - while (to_read != 0 && (wtap_read(info_data.wtap, &err, &err_info, &data_offset))) { - phdr = wtap_phdr(info_data.wtap); - pseudo_header = wtap_pseudoheader(info_data.wtap); - wtap_linktype = phdr->pkt_encap; - buf = wtap_buf_ptr(info_data.wtap); - - capture_info_packet(&info_data.counts, wtap_linktype, buf, phdr->caplen, pseudo_header); - - /*g_warning("new packet");*/ - to_read--; + while (to_read > 0) { + wtap_cleareof(info_data.wtap); + if (wtap_read(info_data.wtap, &err, &err_info, &data_offset)) { + phdr = wtap_phdr(info_data.wtap); + pseudo_header = wtap_pseudoheader(info_data.wtap); + wtap_linktype = phdr->pkt_encap; + buf = wtap_buf_ptr(info_data.wtap); + + capture_info_packet(&info_data.counts, wtap_linktype, buf, phdr->caplen, pseudo_header); + + /*g_warning("new packet");*/ + to_read--; + } } capture_info_ui_update(&info_data.ui); -- cgit v1.2.3