We must always return an error code on an error; otherwise, our caller
will see random crap as the error code. However, if we're skipping a "TCPIPTRACE-W-BUFFERSFUL" error, if the "error" we get is an end-of-file indication, that's *not* an error. It is, however, ultimately a "we dropped some packets" indication; add a comment noting that we should eventually treat it as such. svn path=/trunk/; revision=35337
This commit is contained in:
parent
f780211ade
commit
a22e640a8d
|
@ -289,8 +289,10 @@ static gboolean vms_read(wtap *wth, int *err, gchar **err_info,
|
|||
#else
|
||||
offset = file_tell(wth->fh);
|
||||
#endif
|
||||
if (offset < 1)
|
||||
if (offset < 1) {
|
||||
*err = file_error(wth->fh);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Parse the header */
|
||||
pkt_len = parse_vms_rec_hdr(wth, wth->fh, err, err_info);
|
||||
|
@ -488,9 +490,20 @@ parse_vms_hex_dump(FILE_T fh, int pkt_len, guint8* buf, int *err,
|
|||
}
|
||||
}
|
||||
/* Avoid TCPIPTRACE-W-BUFFERSFUL, TCPIPtrace could not save n packets.
|
||||
* errors. */
|
||||
if (!file_gets(line, VMS_LINE_LENGTH, fh))
|
||||
* errors.
|
||||
*
|
||||
* XXX - when we support packet drop report information in the
|
||||
* Wiretap API, we should parse those lines and return "n" as
|
||||
* a packet drop count. */
|
||||
if (!file_gets(line, VMS_LINE_LENGTH, fh)) {
|
||||
*err = file_error(fh);
|
||||
if (*err == 0) {
|
||||
/* There is no next line, so there's no "TCPIPtrace could not
|
||||
* save n packets" line; not an error. */
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue