Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add support for GETS #12

merged 1 commit into from

2 participants


Small change to add support for the "gets" alias of "get" commands, with test.

Equivalent to the change that went into kestrel recently (twitter/kestrel@d1c93cb)


Thanks for submitting this!

gets isn't an alias for get exactly. It's supposed to also return a CAS value that you can use for synchronization. I'd have expected a memcache client that issued gets to error if the response doesn't have a CAS value.

On the other hand, you're absolutely right that Kestrel is doing this, and I don't see any complaints there. I'll go ahead and merge this change, but I may remove it in the future if it's causing problems.

@erikfrey erikfrey merged commit 38b15e4 into wavii:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 25, 2012
  1. @cjc
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 1 deletion.
  1. +1 −1  src/net/request.cpp
  2. +12 −0 tests/request.cpp
2  src/net/request.cpp
@@ -44,7 +44,7 @@ request_grammar::request_grammar()
>> qi::uint_ [phoenix::ref(req.wait_ms) = qi::_1]
- get = lit("get ") [phoenix::ref(req.type) = request::RT_GET]
+ get = (lit("get ")|lit("gets ")) [phoenix::ref(req.type) = request::RT_GET]
>> key_name [phoenix::ref(req.queue) = qi::_1]
>> *get_option;
12 tests/request.cpp
@@ -46,6 +46,18 @@ BOOST_FIXTURE_TEST_CASE( test_get, fixtures::basic_request )
BOOST_REQUIRE_EQUAL(request_.wait_ms, 500);
+// test that we get some options correctly for a gets
+BOOST_FIXTURE_TEST_CASE( test_gets, fixtures::basic_request )
+ BOOST_REQUIRE(parser_.parse(request_, string("gets bar+woof/t=700/close/open\r\n")));
+ BOOST_REQUIRE_EQUAL(request_.type, darner::request::RT_GET);
+ BOOST_REQUIRE_EQUAL(request_.queue, "bar+woof");
+ BOOST_REQUIRE(request_.get_open);
+ BOOST_REQUIRE(request_.get_close);
+ BOOST_REQUIRE(!request_.get_abort);
+ BOOST_REQUIRE_EQUAL(request_.wait_ms, 700);
// test that reparsing clears fields that were previously set
BOOST_FIXTURE_TEST_CASE( test_reparse, fixtures::basic_request )
Something went wrong with that request. Please try again.