diff options
author | Trond Norbye <trond.norbye@gmail.com> | 2011-08-08 15:47:54 +0200 |
---|---|---|
committer | Trond Norbye <trond.norbye@gmail.com> | 2011-08-08 15:47:54 +0200 |
commit | 911c9d0a6c9a7268358cf4bcff94c33ad012cee7 (patch) | |
tree | 115fe16a57dd696ea79b0d1f2f2b7fd8fdd61816 | |
parent | 2c56090933e01ea5ab7d0c6e6530ea73b0933cf9 (diff) | |
download | memcached-911c9d0a6c9a7268358cf4bcff94c33ad012cee7.tar.gz |
Issue 115: accont for CAS in item_size_ok
-rw-r--r-- | items.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -242,8 +242,13 @@ bool item_size_ok(const size_t nkey, const int flags, const int nbytes) { char prefix[40]; uint8_t nsuffix; - return slabs_clsid(item_make_header(nkey + 1, flags, nbytes, - prefix, &nsuffix)) != 0; + size_t ntotal = item_make_header(nkey + 1, flags, nbytes, + prefix, &nsuffix); + if (settings.use_cas) { + ntotal += sizeof(uint64_t); + } + + return slabs_clsid(ntotal) != 0; } static void item_link_q(item *it) { /* item is the new head */ |