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/wtap.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/wtap.c')
-rw-r--r-- | wiretap/wtap.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 7dcced68fe..6b76e6eed3 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -585,7 +585,10 @@ static const char *wtap_errlist[] = { "Uncompression error: data oddly truncated", "Uncompression error: data would overflow buffer", "Uncompression error: bad LZ77 offset", - "The standard input cannot be opened for random access" + "The standard input cannot be opened for random access", + "That file format doesn't support compression", + NULL, + "Uncompression error" }; #define WTAP_ERRLIST_SIZE (sizeof wtap_errlist / sizeof wtap_errlist[0]) @@ -710,7 +713,7 @@ wtap_read(wtap *wth, int *err, gchar **err_info, gint64 *data_offset) * last packet of the file. */ if (*err == 0) - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); return FALSE; /* failure */ } |