summaryrefslogtreecommitdiff
path: root/wiretap/ascendtext.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
committerGuy Harris <guy@alum.mit.edu>2011-04-21 09:41:52 +0000
commit6cbf6ce16c45c4855ebddd3516465885e3c476d5 (patch)
tree299ce4fc08cb26cc0c0712c6b54de9c76893e7ca /wiretap/ascendtext.c
parent0315e063e4267b97fc7716301350af07dd0f2bea (diff)
downloadwireshark-6cbf6ce16c45c4855ebddd3516465885e3c476d5.tar.gz
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/ascendtext.c')
-rw-r--r--wiretap/ascendtext.c12
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,