summaryrefslogtreecommitdiff
path: root/capture_info.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 /capture_info.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 'capture_info.c')
-rw-r--r--capture_info.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/capture_info.c b/capture_info.c
index 54f01a4a3e..7fe86bbf8d 100644
--- a/capture_info.c
+++ b/capture_info.c
@@ -185,6 +185,14 @@ cf_open_error_message(int err, gchar *err_info, gboolean for_writing,
errmsg = "A full header couldn't be written to the file \"%s\".";
break;
+ case WTAP_ERR_DECOMPRESS:
+ g_snprintf(errmsg_errno, sizeof(errmsg_errno),
+ "The compressed file \"%%s\" appears to be damaged or corrupt.\n"
+ "(%s)", err_info);
+ g_free(err_info);
+ errmsg = errmsg_errno;
+ break;
+
default:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" could not be %s: %s.",