diff options
author | dormando <dormando@rydia.net> | 2017-01-06 00:29:49 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2017-01-06 00:29:49 -0800 |
commit | e9e2819387a77f37991fa77e6e79f6784de01291 (patch) | |
tree | 432bc7a163637e8c194bb0b0b4ab2ad442b1c4ff /crawler.c | |
parent | d58171e8d7d0b1ecbc81cce5ddd57a77f82c5b5a (diff) | |
download | memcached-e9e2819387a77f37991fa77e6e79f6784de01291.tar.gz |
metadump: ensure buffer is flushed before finish
if more than one write/poll() worth of data is in the bipbuf but the crawl is
complete, the client might get released back with an incomplete write.
Diffstat (limited to 'crawler.c')
-rw-r--r-- | crawler.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -400,12 +400,12 @@ static void *item_crawler_thread(void *arg) { if (active_crawler_mod.mod != NULL) { if (active_crawler_mod.mod->finalize != NULL) active_crawler_mod.mod->finalize(&active_crawler_mod); - if (active_crawler_mod.c.c != NULL) { + while (active_crawler_mod.c.c != NULL && bipbuf_used(active_crawler_mod.c.buf)) { lru_crawler_poll(&active_crawler_mod.c); - // Double checking in case the client closed during the poll - if (active_crawler_mod.c.c != NULL) { - lru_crawler_release_client(&active_crawler_mod.c); - } + } + // Double checking in case the client closed during the poll + if (active_crawler_mod.c.c != NULL) { + lru_crawler_release_client(&active_crawler_mod.c); } active_crawler_mod.mod = NULL; } |