diff --git a/notes/TODO b/notes/TODO index 10ac843..4447338 100644 --- a/notes/TODO +++ b/notes/TODO @@ -1,7 +1,10 @@ +* Add a cmd counter (counter for total # of commands) to stats +* Reply strings like NOT_FOUND, EXISTS, etc should come from a #define table +* Add stat to track the memory overhead of hash table and connection module +* Refactor 'struct setting' to use the preprocessor and a #define table * Reintroduce the functionality of MEMCACHED_PORT_FILENAME * Reintroduce the functionality of MEMCACHED_HASH_BULK_MOVE -* Reply strings like NOT_FOUND, EXISTS, etc should come from a #define table * Move hashing of keys outside the cache_lock; exploring saving hash value in item struct * Analyze different hashing algorithms, choose the one that is cheapest -* Add stat to track the memory overhead of hash table and connection module +* Put a cap the size of hashtables * Build a cache warmer or bootstraper, that populates twemcache from a dataset in a file diff --git a/src/mc_ascii.c b/src/mc_ascii.c index 1e94c80..72dd561 100644 --- a/src/mc_ascii.c +++ b/src/mc_ascii.c @@ -735,14 +735,15 @@ asc_process_update(struct conn *c, struct token *token, int ntoken) } } - vlen += CRLF_LEN; - if (vlen < 0 || (vlen - CRLF_LEN) < 0) { + if (vlen < 0) { log_debug(LOG_INFO, "client error on c %d for req of type %d and " "invalid vlen %d", c->sd, c->req_type, vlen); asc_write_client_error(c); return; } + vlen += CRLF_LEN; + it = item_alloc(key, nkey, flags, time_reltime(exptime), vlen); if (it == NULL) { log_debug(LOG_DEBUG, "server error on c %d for req of type %d because "