summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCharmander <~@charmander.me>2018-06-16 06:51:40 -0700
committerdormando <dormando@rydia.net>2018-06-27 00:19:59 -0700
commitafdb75cbe26eb217e3c664a4fc0b3513458bc4f8 (patch)
treefdfc24090708d040a69e70e6f301143dc55c2dae /scripts
parent3c34df7d851e351eb5e571b2c4e4440e4408c9c6 (diff)
downloadmemcached-afdb75cbe26eb217e3c664a4fc0b3513458bc4f8.tar.gz
Include keys with non-[\w.~-] bytes in memcached-tool dump
`lru_crawler metadump` uses `uriencode`.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/memcached-tool7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/memcached-tool b/scripts/memcached-tool
index 39156d7..cab36a5 100755
--- a/scripts/memcached-tool
+++ b/scripts/memcached-tool
@@ -98,10 +98,13 @@ if ($mode eq 'dump') {
# return format looks like this
# key=foo exp=2147483647 la=1521046038 cas=717111 fetch=no cls=13 size=1232
if (/^key=(\S+) exp=(-?\d+) .*/) {
+ my $k = $1;
+ $k =~ s/%(.{2})/chr hex $1/eg;
+
if ($2 == -1) {
- $keyexp{$1} = 0;
+ $keyexp{$k} = 0;
} else {
- $keyexp{$1} = $2;
+ $keyexp{$k} = $2;
}
}
$keycount++;