summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-24 05:05:29 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-24 05:05:29 +0000
commitcf6d9841e37906448ad1a571a648140325efcae0 (patch)
tree8e14522dbdae5295fd41a236e7f9e49daab36c4e /file.c
parent73888ed977e7ba3356d3c5e31c182508d576dfc1 (diff)
downloadwireshark-cf6d9841e37906448ad1a571a648140325efcae0.tar.gz
Keep track, in Wiretap, of whether the file is compressed, and provide
an API to fetch that. When doing "Save" on a compressed file, write it out compressed. In the Statistics -> Summary dialog and in capinfos, report whether the file is gzip-compressed. svn path=/trunk/; revision=42818
Diffstat (limited to 'file.c')
-rw-r--r--file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/file.c b/file.c
index e04d4a4194..bfbc293ab1 100644
--- a/file.c
+++ b/file.c
@@ -530,6 +530,9 @@ cf_read(capture_file *cf, gboolean reloading)
else
cf_callback_invoke(cf_cb_file_read_started, cf);
+ /* Record whether the file is compressed. */
+ cf->iscompressed = wtap_iscompressed(cf->wth);
+
/* Find the size of the file. */
size = wtap_file_size(cf->wth, NULL);
@@ -3818,7 +3821,8 @@ cf_save_packets(capture_file *cf, const char *fname, guint save_format,
cf_callback_invoke(cf_cb_file_save_started, (gpointer)fname);
- if (save_format == cf->cd_t && !cf->unsaved_changes) {
+ if (save_format == cf->cd_t && compressed == cf->iscompressed
+ && !cf->unsaved_changes) {
/* We're saving in the format it's already in, and there are no
changes we have in memory that aren't saved to the file, so
we can just move or copy the raw data. */