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"
/*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);