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/k12.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/k12.c')
-rw-r--r-- | wiretap/k12.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/k12.c b/wiretap/k12.c index fda91d1743..1064a04ac0 100644 --- a/wiretap/k12.c +++ b/wiretap/k12.c @@ -301,7 +301,7 @@ static gint get_record(guint8** bufferp, FILE_T fh, gint64 file_offset, return 0; } else if ( bytes_read < 0x14 ){ K12_DBG(1,("get_record: SHORT READ OR ERROR")); - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) { *err = WTAP_ERR_SHORT_READ; } @@ -318,7 +318,7 @@ static gint get_record(guint8** bufferp, FILE_T fh, gint64 file_offset, return 0; } else if ( bytes_read != 0x4 ) { K12_DBG(1,("get_record: SHORT READ OR ERROR")); - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) { *err = WTAP_ERR_SHORT_READ; } @@ -355,7 +355,7 @@ static gint get_record(guint8** bufferp, FILE_T fh, gint64 file_offset, if ( last_read != left ) { K12_DBG(1,("get_record: SHORT READ OR ERROR")); - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) { *err = WTAP_ERR_SHORT_READ; } @@ -369,7 +369,7 @@ static gint get_record(guint8** bufferp, FILE_T fh, gint64 file_offset, if ( last_read != junky_offset ) { K12_DBG(1,("get_record: SHORT READ OR ERROR, read=%d expected=%d",last_read, junky_offset)); - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) { *err = WTAP_ERR_SHORT_READ; } @@ -382,7 +382,7 @@ static gint get_record(guint8** bufferp, FILE_T fh, gint64 file_offset, if ( last_read != 0x10 ) { K12_DBG(1,("get_record: SHORT READ OR ERROR")); - *err = file_error(fh); + *err = file_error(fh, err_info); if (*err == 0) { *err = WTAP_ERR_SHORT_READ; } @@ -691,7 +691,7 @@ int k12_open(wtap *wth, int *err, gchar **err_info) { if ( file_read(header_buffer,0x200,wth->fh) != 0x200 ) { K12_DBG(1,("k12_open: FILE HEADER TOO SHORT OR READ ERROR")); - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); if (*err != 0) { return -1; } |