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/jpeg_jfif.c | |
parent | 0315e063e4267b97fc7716301350af07dd0f2bea (diff) | |
download | wireshark-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/jpeg_jfif.c')
-rw-r--r-- | wiretap/jpeg_jfif.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/wiretap/jpeg_jfif.c b/wiretap/jpeg_jfif.c index bd036e155b..c592a8075f 100644 --- a/wiretap/jpeg_jfif.c +++ b/wiretap/jpeg_jfif.c @@ -83,7 +83,7 @@ jpeg_jfif_read(wtap *wth, int *err, gchar **err_info, buffer_assure_space(wth->frame_buffer, packet_size); buf = buffer_start_ptr(wth->frame_buffer); - wtap_file_read_expected_bytes(buf, packet_size, wth->fh, err); + wtap_file_read_expected_bytes(buf, packet_size, wth->fh, err, err_info); wth->data_offset += packet_size; @@ -116,7 +116,8 @@ jpeg_jfif_seek_read(wtap *wth, gint64 seek_off, return FALSE; } - wtap_file_read_expected_bytes(pd, packet_size, wth->random_fh, err); + wtap_file_read_expected_bytes(pd, packet_size, wth->random_fh, err, + err_info); *err = 0; *err_info = NULL; @@ -133,7 +134,7 @@ jpeg_jfif_open(wtap *wth, int *err, gchar **err_info) errno = WTAP_ERR_CANT_READ; bytes_read = file_read(magic_buf, sizeof(magic_buf), wth->fh); if (bytes_read != (int) sizeof(magic_buf)) { - *err = file_error(wth->fh); + *err = file_error(wth->fh, err_info); if (*err != 0) { *err_info = NULL; ret = -1; |