diff options
author | Ladar Levison <ladar@lavabit.com> | 2019-01-28 19:03:38 +0300 |
---|---|---|
committer | Ladar Levison <ladar@lavabit.com> | 2019-01-28 19:03:38 +0300 |
commit | d56176c8add5222a9d933ec8c3cf229da9d09a3e (patch) | |
tree | 1a82ccbc7825baba2725368f1ddabd3a0baba3f3 | |
parent | 56e9a31d1b8915552e3279924c5af1919141e660 (diff) |
Reoriented the dump result check loop.
-rw-r--r-- | lib/patches/memcached/1.0.18_fix_dump_return_code.patch | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/patches/memcached/1.0.18_fix_dump_return_code.patch b/lib/patches/memcached/1.0.18_fix_dump_return_code.patch index 3ae0b6b3..8c3750df 100644 --- a/lib/patches/memcached/1.0.18_fix_dump_return_code.patch +++ b/lib/patches/memcached/1.0.18_fix_dump_return_code.patch @@ -1,5 +1,5 @@ diff --git a/libmemcached/dump.cc b/libmemcached/dump.cc -index 8ddb2ee..864374d 100644 +index 8ddb2ee..2f93452 100644 --- a/libmemcached/dump.cc +++ b/libmemcached/dump.cc @@ -1,5 +1,5 @@ @@ -27,7 +27,7 @@ index 8ddb2ee..864374d 100644 memcached_literal_param("snprintf(MEMCACHED_DEFAULT_COMMAND_SIZE)")); } -@@ -70,22 +71,34 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac +@@ -70,22 +71,28 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac { memcached_instance_st* instance= memcached_instance_fetch(memc, server_key); @@ -38,11 +38,9 @@ index 8ddb2ee..864374d 100644 - } - else + // Starting with version 1.4.23 the slab size went from 200 to 63. -+ -+ // Starting with version 1.4.23 the slab size went from 200 to 63. + if (x <= 63 || + (instance->major_version == 1 && instance->minor_version == 4 && instance->micro_version < 23) || -+ (instance->major_version == 1 && instance->minor_version < 4)) ++ (instance->major_version <= 1 && instance->minor_version < 4)) { - return vdo_rc; + memcached_return_t vdo_rc; @@ -57,19 +55,18 @@ index 8ddb2ee..864374d 100644 } } -+ memcached_flush_buffers(memc); -+ usleep(1000); -+ // Collect the returned items - memcached_instance_st* instance; - memcached_return_t read_ret= MEMCACHED_SUCCESS; - while ((instance= memcached_io_get_readable_server(memc, read_ret))) +- memcached_instance_st* instance; +- memcached_return_t read_ret= MEMCACHED_SUCCESS; +- while ((instance= memcached_io_get_readable_server(memc, read_ret))) ++ for (uint32_t server_key= 0; server_key < memcached_server_count(memc); server_key++) { -+ ++ memcached_instance_st* instance= memcached_instance_fetch(memc, server_key); ++ memcached_return_t read_ret= memcached_io_wait_for_read(instance); memcached_return_t response_rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL); if (response_rc == MEMCACHED_ITEM) { -@@ -111,18 +124,18 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac +@@ -111,18 +118,18 @@ static memcached_return_t ascii_dump(Memcached *memc, memcached_dump_fn *callbac } } else if (response_rc == MEMCACHED_END) @@ -95,7 +92,7 @@ index 8ddb2ee..864374d 100644 assert(response_rc == MEMCACHED_SUCCESS); // Just fail return response_rc; } -@@ -146,7 +159,7 @@ memcached_return_t memcached_dump(memcached_st *shell, memcached_dump_fn *callba +@@ -146,7 +153,7 @@ memcached_return_t memcached_dump(memcached_st *shell, memcached_dump_fn *callba return rc; } |