Skip to content

Commit df964da

Browse files
committed
fix version and stat commands failing on MEMCACHED_SOME_ERRORS
1 parent 78bacd7 commit df964da

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

include/libmemcached-1.0/return.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static inline bool memcached_fatal(memcached_return_t rc) {
3131
return (rc != MEMCACHED_AUTH_CONTINUE && rc != MEMCACHED_BUFFERED && rc != MEMCACHED_CLIENT_ERROR
3232
&& rc != MEMCACHED_DATA_EXISTS && rc != MEMCACHED_DELETED && rc != MEMCACHED_E2BIG
3333
&& rc != MEMCACHED_END && rc != MEMCACHED_ITEM && rc != MEMCACHED_ERROR
34-
&& rc != MEMCACHED_NOTFOUND && rc != MEMCACHED_NOTSTORED
34+
&& rc != MEMCACHED_NOTFOUND && rc != MEMCACHED_NOTSTORED && rc != MEMCACHED_SOME_ERRORS
3535
&& rc != MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE && rc != MEMCACHED_STAT
3636
&& rc != MEMCACHED_STORED && rc != MEMCACHED_SUCCESS && rc != MEMCACHED_VALUE);
3737
}

src/libmemcached/stats.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,9 @@ static memcached_return_t call_stat_fn(memcached_st *memc, memcached_instance_st
616616
memcached_return_t memcached_stat_execute(memcached_st *shell, const char *args,
617617
memcached_stat_fn func, void *context) {
618618
Memcached *memc = memcached2Memcached(shell);
619-
if (memcached_fatal(memcached_version(memc))) {
620-
return memcached_last_error(memc);
619+
memcached_return_t rc = memcached_version(memc);
620+
if (memcached_fatal(rc)) {
621+
return rc;
621622
}
622623

623624
local_context check(func, context, args, args ? strlen(args) : 0);

0 commit comments

Comments
 (0)