Where do I find the invalid characters for a memcached key?

4,946 views
Skip to first unread message

Chris

unread,
Feb 8, 2011, 12:44:14 PM2/8/11
to memcached
Where do I find the invalid characters for a memcached key?

dormando

unread,
Feb 8, 2011, 12:55:19 PM2/8/11
to memcached
> Where do I find the invalid characters for a memcached key?

Buried in the wiki somewhere + protocol.txt.

in short, for ascii; no spaces or newlines.

Marc Bollinger

unread,
Feb 8, 2011, 1:01:07 PM2/8/11
to memc...@googlegroups.com
I understand why the 'official' protocol.txt is where it is, but to get 
there from memcached.org, you go from

which just seems kind of janky.

- Marc

dormando

unread,
Feb 8, 2011, 1:13:04 PM2/8/11
to memc...@googlegroups.com
protocol.txt also comes with the software... so technically it's
memcached.org -> tarball -> spend 1.75 seconds doing `ls`

Or typing "memcached key" into google gets you enough results.

Or wiki -> protocol/commands (two clicks!) though the key stuff should be
repeated at the top there (just fixed that). Probably should be repeated
somewhere else too, which we'll improve next time.

Marc Bollinger

unread,
Feb 8, 2011, 1:23:30 PM2/8/11
to memc...@googlegroups.com
Ah, awesome. Yeah, I noticed the key stuff wasn't in protocol/commands,
which is why I went digging in the first place. Good point on with the
distribution though, I was staring at the document in the repo without 
thinking, "this obviously _comes_ with memcached."

- Marc
--
Marc Bollinger
mboll...@gmail.com

Dustin

unread,
Feb 8, 2011, 2:36:45 PM2/8/11
to memcached

On Feb 8, 10:23 am, Marc Bollinger <mbollin...@gmail.com> wrote:
> Ah, awesome. Yeah, I noticed the key stuff wasn't in protocol/commands,
> which is why I went digging in the first place. Good point on with the
> distribution though, I was staring at the document in the repo without
> thinking, "this obviously _comes_ with memcached."

It's also the first google result for "protocol.txt" -- which I find
handy. :)

Henrik Schröder

unread,
Feb 9, 2011, 6:09:04 AM2/9/11
to memc...@googlegroups.com
Using the text protocol, a key can't be empty, can't be longer than 250 characters, and can't contain space, newline, return, tab, vertical tab or form feed. Everything else is fine.


/Henrik Schröder

Henrik Schröder

unread,
Feb 9, 2011, 6:17:48 AM2/9/11
to memc...@googlegroups.com
On Tue, Feb 8, 2011 at 19:13, dormando <dorm...@rydia.net> wrote:


Or wiki -> protocol/commands (two clicks!) though the key stuff should be
repeated at the top there (just fixed that). Probably should be repeated
somewhere else too, which we'll improve next time.

The wiki says that only space and newlines are disallowed, have you changed the code to allow return, tab, vertical tab and form feed?


/Henrik Schröder

dormando

unread,
Feb 10, 2011, 3:18:34 PM2/10/11
to memc...@googlegroups.com
> Or wiki -> protocol/commands (two clicks!) though the key stuff should be
> repeated at the top there (just fixed that). Probably should be repeated
> somewhere else too, which we'll improve next time.
>
>
> The wiki says that only space and newlines are disallowed, have you changed the code to allow return, tab, vertical tab and form feed?

nitpicky! though we seem to get plenty of people who would see "no spaces"
and think space-like things such as tabs would be perfectly good.

guess I'll fix that harder soon. or anyone else is welcome to edit the
wiki too :P doesn't always have to be me.

Trond Norbye

unread,
Feb 10, 2011, 3:31:48 PM2/10/11
to memc...@googlegroups.com

the wiki also say that the command should be on one line... it's going to be kind of hard to do that with a return in there...

and for the record, using a tab in the key works ;-)

Cheers,

Trond

Adam Thomason

unread,
Feb 10, 2011, 4:23:18 PM2/10/11
to memc...@googlegroups.com
Some clients may exhibit weird behavior if there are characters in the key with the high bit set. perl's Cache::Memcached::GetParserXS comes to mind.

On Tue, Feb 8, 2011 at 9:55 AM, dormando <dorm...@rydia.net> wrote:
Reply all
Reply to author
Forward
0 new messages