X-Git-Url: http://git.samba.org/samba.git/?p=obnox%2Fwireshark%2Fwip.git;a=blobdiff_plain;f=capture_info.c;h=48102d94749042bf13ac0f8a6568934805c531e2;hp=7fe86bbf8d9e83a0758724a0491ebf10b11d95a3;hb=f3c613ffcc1ba4e1dd36e83c844ee56076d75852;hpb=bf5d8d18e36e02f7f197738afc830e2c4341dd69 diff --git a/capture_info.c b/capture_info.c index 7fe86bbf8d..48102d9474 100644 --- a/capture_info.c +++ b/capture_info.c @@ -160,7 +160,7 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing, errmsg = "The file \"%s\" is a capture for a network type that TShark doesn't support."; break; - case WTAP_ERR_BAD_RECORD: + case WTAP_ERR_BAD_FILE: /* Seen only when opening a capture file for reading. */ g_snprintf(errmsg_errno, sizeof(errmsg_errno), "The file \"%%s\" appears to be damaged or corrupt.\n" @@ -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); + 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); + capture_info_packet(&info_data.counts, wtap_linktype, buf, phdr->caplen, pseudo_header); - /*g_warning("new packet");*/ - to_read--; + /*g_warning("new packet");*/ + to_read--; + } } capture_info_ui_update(&info_data.ui);