Skip to content
Browse files

base64-encode the keys too

  • Loading branch information...
1 parent 34bc771 commit 2ed14a4b46bb190a3f6485e964cc28c04b79d267 @clofresh committed Mar 4, 2010
Showing with 3 additions and 0 deletions.
  1. +3 −0 memnado.py
View
3 memnado.py
@@ -15,13 +15,16 @@ def __init__(self, host, port):
self.stream = IOStream(s)
def set(self, key, value, callback, expiry=0):
+ key = b64encode(key)
value = b64encode(value)
content_length = len(value)
self.stream.write("set %s 1 %s %s\r\n%s\r\n" % (key, expiry,
content_length, value))
self.stream.read_until("\r\n", callback)
def get(self, key, callback):
+ key = b64encode(key)
+
def process_get(stream, cb, data):
if data[0:3] == 'END': # key is empty
cb(None)

0 comments on commit 2ed14a4

Please sign in to comment.
Something went wrong with that request. Please try again.