summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-12-22 00:37:10 +0100
committerPeter Wu <peter@lekensteyn.nl>2016-12-22 00:37:10 +0100
commitbda525b6c24a9a624fc8b2a21ff2a74aaec8ea32 (patch)
tree557120176958230fc3819b3e21f6a51affc5f77c
parent8d3900ef5f476b0a56590bb9e8ef37bf79fdff82 (diff)
downloadwireshark-notes-bda525b6c24a9a624fc8b2a21ff2a74aaec8ea32.tar.gz
file-zip: allow decompression to be disabled
Allow decompression to be disabled for performance reasons.
-rw-r--r--lua/file-zip.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/lua/file-zip.lua b/lua/file-zip.lua
index e4842d0..b50e62b 100644
--- a/lua/file-zip.lua
+++ b/lua/file-zip.lua
@@ -40,6 +40,8 @@ local function make_fields(field_abbr_prefix, field_defs, hfs_out, hfs_list_out)
end
local proto_zip = Proto.new("zip_archive", "Zip Archive")
+proto_zip.prefs.decompress = Pref.bool("Decompress file data", true,
+ "Whether file data should be decompressed or not.")
local hf = {}
local general_purpose_flags_def = {
_ = {ProtoField.uint16, "General purpose bit flag", base.HEX},
@@ -301,8 +303,8 @@ local function dissect_one(tvb, offset, pinfo, tree)
end
if data_len and data_len > 0 then
subtree:add(hf.entry.data, tvb(offset, data_len))
- -- Try to decompress Deflate
- if comp_method == 8 then
+ -- Try to decompress Deflate (if allowed)
+ if proto_zip.prefs.decompress and comp_method == 8 then
local data_tvb = tvb(offset, data_len):uncompress("Decompressed data")
if data_tvb then
subtree:add(hf.entry.data_uncomp, data_tvb)