aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-couchbase.c
diff options
context:
space:
mode:
authorJim Walker <jim@couchbase.com>2018-12-07 11:58:31 +0000
committerMichael Mann <mmann78@netscape.net>2018-12-07 20:24:15 +0000
commite914a5a3773e23b043fbe5c080d938ffad2b259f (patch)
tree1150186df8aabd19e3b00a4d07aad3e61b9f063a /epan/dissectors/packet-couchbase.c
parent27187536e69af7d50db498f2c58d8b1ce73b693f (diff)
couchbase: Improve key decoder
Using the recent updates occasional 'trailing' byte warnings occur if the key encodes a collection-ID, with these changes we now get much better key decoding, without the warnings with and without collections. Change-Id: I9fc1e0d807c8054065a7346a09b0ce99d05f1e63 Reviewed-on: https://code.wireshark.org/review/30956 Reviewed-by: Dave Rigby <daver@couchbase.com> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-couchbase.c')
-rw-r--r--epan/dissectors/packet-couchbase.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-couchbase.c b/epan/dissectors/packet-couchbase.c
index 93e49dbcd1..7886ae01a8 100644
--- a/epan/dissectors/packet-couchbase.c
+++ b/epan/dissectors/packet-couchbase.c
@@ -1576,7 +1576,7 @@ dissect_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
gboolean missing = FALSE; /* Set when key is missing */
if (keylen) {
- ti = proto_tree_add_item(tree, hf_key, tvb, offset, keylen, ENC_ASCII | ENC_NA);
+ ti = proto_tree_add_item(tree, hf_key, tvb, offset, keylen, ENC_UTF_8|ENC_STR_HEX);
/* assume collections are enabled and add a field for the CID */
guint32 cid = 0;
@@ -1598,7 +1598,7 @@ dissect_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvb,
ok,
keylen - (ok - offset),
- ENC_ASCII | ENC_NA);
+ ENC_UTF_8|ENC_STR_HEX);
} else {
/* cid decode issue, could just be a non-collection stream, don't warn
just add some info */
@@ -2645,8 +2645,8 @@ proto_register_couchbase(void)
{ &hf_ttp, { "Time to Persist", "couchbase.ttp", FT_UINT32, BASE_DEC, NULL, 0x0, "Approximate time needed to persist the key (milliseconds)", HFILL } },
{ &hf_ttr, { "Time to Replicate", "couchbase.ttr", FT_UINT32, BASE_DEC, NULL, 0x0, "Approximate time needed to replicate the key (milliseconds)", HFILL } },
- { &hf_collection_key_id, { "Collection ID", "couchbase.key.collection_id", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } },
- { &hf_collection_key_logical, { "Collection Logical Key", "couchbase.key.logical_key", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_collection_key_id, { "Collection ID", "couchbase.key.collection_id", FT_UINT32, BASE_HEX, NULL, 0x0, "If this a collection stream, this is the collection-ID", HFILL } },
+ { &hf_collection_key_logical, { "Collection Logical Key", "couchbase.key.logical_key", FT_STRING, BASE_NONE, NULL, 0x0, "If this a collection stream, this is the key in the collection", HFILL } },
{ &hf_flex_keylength, { "Key Length", "couchbase.key.length", FT_UINT8, BASE_DEC, NULL, 0x0, "Length in bytes of the text key that follows the command extras", HFILL } },
{ &hf_flex_extras_length, { "Flexible Framing Extras Length", "couchbase.flex_extras", FT_UINT8, BASE_DEC, NULL, 0x0, "Length in bytes of the flexible framing extras that follows the response header", HFILL } },
@@ -2739,7 +2739,7 @@ proto_register_couchbase(void)
{ &hf_extras_delta, { "Amount to Add", "couchbase.extras.delta", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_extras_initial, { "Initial Value", "couchbase.extras.initial", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } },
{ &hf_extras_unknown, { "Unknown", "couchbase.extras.unknown", FT_BYTES, BASE_NONE, NULL, 0x0, "Unknown Extras", HFILL } },
- { &hf_key, { "Key", "couchbase.key", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
+ { &hf_key, { "Key", "couchbase.key", FT_STRING, BASE_NONE, NULL, 0x0, "If this is a collection stream, the key is formed of a leb128 prefix and then the key", HFILL } },
{ &hf_path, { "Path", "couchbase.path", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_value, { "Value", "couchbase.value", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_uint64_response, { "Response", "couchbase.extras.response", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL } },