diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-04-21 09:41:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-04-21 09:41:52 +0000 |
commit | 6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch) | |
tree | 299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/network_instruments.c | |
parent | 0315e063e4267b97fc7716301350af07dd0f2bea (diff) |
Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discovered
by the gunzipping code. Have it also supply a err_info string, and
report it. Have file_error() supply an err_info string.
Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to
suggest a decompression error - into the rawshark and tshark errors,
along the lines of what other programs print.
Fix a case in the Netscaler code where we weren't fetching the error
code on a read failure.
svn path=/trunk/; revision=36748
Diffstat (limited to 'wiretap/network_instruments.c')
-rw-r--r-- | wiretap/network_instruments.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/network_instruments.c b/wiretap/network_instruments.c index b11a526f59..c6c1fa93fb 100644 --- a/wiretap/network_instruments.c +++ b/wiretap/network_instruments.c @@ -118,7 +118,7 @@ int network_instruments_open(wtap *wth, int *err, gchar **err_info) /* read in the buffer file header */ bytes_read = file_read(&file_header, sizeof file_header, wth->fh); if (bytes_read != sizeof file_header) { - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); if (*err != 0) return -1; return 0; @@ -142,7 +142,7 @@ int network_instruments_open(wtap *wth, int *err, gchar **err_info) /* read the TLV header */ bytes_read = file_read(&tlvh, sizeof tlvh, wth->fh); if (bytes_read != sizeof tlvh) { - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); if (*err == 0) *err = WTAP_ERR_SHORT_READ; return -1; @@ -184,7 +184,7 @@ int network_instruments_open(wtap *wth, int *err, gchar **err_info) /* pull off the packet header */ bytes_read = file_read(&packet_header, sizeof packet_header, wth->fh); if (bytes_read != sizeof packet_header) { - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); if (*err != 0) return -1; return 0; @@ -348,7 +348,7 @@ read_packet_header(FILE_T fh, packet_entry_header *packet_header, int *err, /* pull off the packet header */ bytes_read = file_read(packet_header, sizeof *packet_header, fh); if (bytes_read != sizeof *packet_header) { - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err != 0) return -1; return 0; /* EOF */ @@ -398,7 +398,7 @@ read_packet_header(FILE_T fh, packet_entry_header *packet_header, int *err, /* read the TLV header */ bytes_read = file_read(&tlvh, sizeof tlvh, fh); if (bytes_read != sizeof tlvh) { - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) *err = WTAP_ERR_SHORT_READ; return -1; @@ -445,7 +445,7 @@ read_packet_data(FILE_T fh, int offset_to_frame, int offset, guint8 *pd, } /* read in the packet */ - wtap_file_read_expected_bytes(pd, length, fh, err); + wtap_file_read_expected_bytes(pd, length, fh, err, err_info); return TRUE; } |