diff options
author | dormando <dormando@rydia.net> | 2019-05-14 20:31:39 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2019-05-20 13:14:44 -0700 |
commit | 31208e8fbeceea163c2fd95dd1031ec684d88fc3 (patch) | |
tree | 072ec372d4d8c16716d5df90ccf57490ed919892 /items.c | |
parent | 4723d424f32acc3ee544d3a7bd91b9f05fe4c608 (diff) | |
download | memcached-31208e8fbeceea163c2fd95dd1031ec684d88fc3.tar.gz |
remove inline_ascii_response option
Has defaulted to false since 1.5.0, and with -o modern for a few years
before that. Performance is fine, no reported bugs. Always was the
intention. Code is simpler without the options.
Diffstat (limited to 'items.c')
-rw-r--r-- | items.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -168,15 +168,10 @@ unsigned int do_get_lru_size(uint32_t id) { */ static size_t item_make_header(const uint8_t nkey, const unsigned int flags, const int nbytes, char *suffix, uint8_t *nsuffix) { - if (settings.inline_ascii_response) { - /* suffix is defined at 40 chars elsewhere.. */ - *nsuffix = (uint8_t) snprintf(suffix, 40, " %u %d\r\n", flags, nbytes - 2); + if (flags == 0) { + *nsuffix = 0; } else { - if (flags == 0) { - *nsuffix = 0; - } else { - *nsuffix = sizeof(flags); - } + *nsuffix = sizeof(flags); } return sizeof(item) + nkey + *nsuffix + nbytes; } @@ -334,11 +329,7 @@ item *do_item_alloc(char *key, const size_t nkey, const unsigned int flags, it->nbytes = nbytes; memcpy(ITEM_key(it), key, nkey); it->exptime = exptime; - if (settings.inline_ascii_response) { - memcpy(ITEM_suffix(it), suffix, (size_t)nsuffix); - } else if (nsuffix > 0) { - memcpy(ITEM_suffix(it), &flags, sizeof(flags)); - } + memcpy(ITEM_suffix(it), &flags, sizeof(flags)); it->nsuffix = nsuffix; /* Initialize internal chunk. */ |