зеркало из https://github.com/github/memcached.git
Initialize error to MEMCACHED_TIMEOUT to work around upstream bug where error is uninitialized on timeouts /cc evan/memcached#89
This commit is contained in:
Родитель
543d5bc922
Коммит
073bbbfcff
|
@ -208,6 +208,7 @@ VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, u
|
|||
VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
|
||||
size_t value_length = 0;
|
||||
VALUE ary = rb_ary_new();
|
||||
if (error) *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
|
||||
char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
|
||||
VALUE str = rb_str_new_by_ref(value, value_length);
|
||||
rb_ary_push(ary, str);
|
||||
|
|
|
@ -2304,6 +2304,7 @@ VALUE memcached_get_from_last_rvalue(memcached_st *ptr, const char *key, size_t
|
|||
VALUE memcached_fetch_rvalue(memcached_st *ptr, char *key, size_t *key_length, uint32_t *flags, memcached_return *error) {
|
||||
size_t value_length = 0;
|
||||
VALUE ary = rb_ary_new();
|
||||
if (error) *error = MEMCACHED_TIMEOUT; // timeouts leave error uninitialized
|
||||
char *value = memcached_fetch(ptr, key, key_length, &value_length, flags, error);
|
||||
VALUE str = rb_str_new_by_ref(value, value_length);
|
||||
rb_ary_push(ary, str);
|
||||
|
|
Загрузка…
Ссылка в новой задаче