Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whitespace key is not allowed when reading an existing key from memcached #79

Open
farshidce opened this issue Apr 15, 2018 · 1 comment

Comments

@farshidce
Copy link

is there a reason why legalKey function returns False if the binary key has whitespace character ?

having a key with whitespace is not an issue when using `python-binary-memcached in spite of https://github.com/memcached/memcached/blob/95e6469bd2ceef92bcaaf140e2724fc73d556185/doc/protocol.txt#L49.

for instance I am able to set and retrieve a binary key ((' \u039b\ufffd\ufffd#\ufffdm')) or (' ��#�m') from python but unable to read this key using gomemcache due to this check :

if key[i] <= ' ' || key[i] == 0x7f {

python code:

from bmemcached import Client
client.set(' \u039b\ufffd\ufffd#\ufffdm', "sample value")
print(client.get(' \u039b\ufffd\ufffd#\ufffdm'))

Go

mc.Get(" \u039b\ufffd\ufffd#\ufffdm")
@victor-perov
Copy link

According to the Protocol standard (https://github.com/memcached/memcached/wiki/Commands#standard-protocol):

A key (arbitrary string up to 250 bytes in length. No space or newlines for ASCII mode)

seems like it's not an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants