Browse files

Allow memcached-tool to sample keys containing punctuation

Summary: The Perl regular expression that was being used to match
         a cache key was treating colons as word breaks, so it
         couldn't read most of our keys.

Reviewed By: hzhao

Test Plan: Point the tool at one of our memcached instances and
           verify that it can now dump out a bunch of our cache items.

Revert: OK



git-svn-id: http://svn.facebook.com/svnroot/projects/memcached/trunk@62536 2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  • Loading branch information...
1 parent 29f030a commit 1755e8a3e4fed240a1ab3f0cbc6fb4622ddf706c sgrimm committed Oct 5, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/memcached-tool
View
4 scripts/memcached-tool
@@ -105,7 +105,7 @@ if ($mode eq 'dump') {
last if /^END/;
# return format looks like this
# ITEM foo [6 b; 1176415152 s]
- if (/^ITEM (\w+) \[.* (\d+) s\]/) {
+ if (/^ITEM (\S+) \[.* (\d+) s\]/) {
$keyexp{$1} = $2;
}
}
@@ -114,7 +114,7 @@ if ($mode eq 'dump') {
my $val;
print $sock "get $k\r\n";
my $response = <$sock>;
- $response =~ /VALUE (\w+) (\d+) (\d+)/;
+ $response =~ /VALUE (\S+) (\d+) (\d+)/;
my $flags = $2;
my $len = $3;
read $sock, $val , $len;

0 comments on commit 1755e8a

Please sign in to comment.