diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-21 09:41:52 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-21 09:41:52 +0000 |
commit | bf5d8d18e36e02f7f197738afc830e2c4341dd69 (patch) | |
tree | 299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/ascendtext.c | |
parent | bf80a1d2d0395923cfd70fe3ce9a5e20b6f94466 (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.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36748 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'wiretap/ascendtext.c')
-rw-r--r-- | wiretap/ascendtext.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/ascendtext.c b/wiretap/ascendtext.c index c55f9df5d3..801a01fe9b 100644 --- a/wiretap/ascendtext.c +++ b/wiretap/ascendtext.c @@ -93,7 +93,7 @@ static gboolean ascend_seek_read(wtap *wth, gint64 seek_off, /* Seeks to the beginning of the next packet, and returns the byte offset at which the header for that packet begins. Returns -1 on failure. */ -static gint64 ascend_seek(wtap *wth, int *err) +static gint64 ascend_seek(wtap *wth, int *err, gchar **err_info) { int byte; gint64 date_off = -1, cur_off, packet_off; @@ -121,7 +121,7 @@ static gint64 ascend_seek(wtap *wth, int *err) cur_off = file_tell(wth->fh); if (cur_off == -1) { /* Error. */ - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); return -1; } @@ -156,7 +156,7 @@ static gint64 ascend_seek(wtap *wth, int *err) } else { /* We (presumably) got an error (there's no equivalent to "ferror()" in zlib, alas, so we don't have a wrapper to check for an error). */ - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); } return -1; @@ -173,7 +173,7 @@ found: return packet_off; } -int ascend_open(wtap *wth, int *err, gchar **err_info _U_) +int ascend_open(wtap *wth, int *err, gchar **err_info) { gint64 offset; struct stat statbuf; @@ -187,7 +187,7 @@ int ascend_open(wtap *wth, int *err, gchar **err_info _U_) fill it in. */ wth->priv = NULL; - offset = ascend_seek(wth, err); + offset = ascend_seek(wth, err, err_info); if (offset == -1) { if (*err == 0) return 0; @@ -285,7 +285,7 @@ static gboolean ascend_read(wtap *wth, int *err, gchar **err_info, SEEK_SET, err) == -1) return FALSE; - offset = ascend_seek(wth, err); + offset = ascend_seek(wth, err, err_info); if (offset == -1) return FALSE; if (parse_ascend(wth->fh, buf, &wth->pseudo_header.ascend, &header, |