rsms/smisk — pull request #6 by emilisto (2012-05-16 09:12:50+00:00)
Title: MemcachedSessionStore

Hey

I've started working on a `MemcachedSessionStore` for smisk as an alternative to the `FileSessionStore` that can be shared by multiple instances of smisk, not running on the same machine.

Note that this is not ready to be pulled into the master repo, but I just wanted to give you a heads up and possibly get some input.

The commit concerning the uid generation uid.c can be ignored - for some reason I get a buffer overflow when running sha1_final() on my Mac OS system. I haven't put any effort into fixing this, and so just replaced it with a silly "id generation". I can give you more details on this if you wish!

Right now what remains is:

- See if there's a nicer way to run `refresh()` without fetching the session from the memcached server, maybe an API change that passes `data` to the `refresh()` function as is done for `write()`.
- Make this an optional `SessionStore` - right now I've hardcoded it - just like was done for FileSessionStore previously. Any pointers on how this should be done?
- Garbage collection code
- Check INCREF/DECREF in the code - this is my first take with the Python C API so I've been pretty sloppy with the reference counting
- Make sure that `memcached_string` is read from a config parameter

Oh, and to be able to deploy this in production I've based it on the v1.1.6 tag, but it should be easily merged into master.

Mvh
Emil