зеркало из https://github.com/github/memcached.git
Fix clone method
This commit is contained in:
Родитель
898b008e7d
Коммит
7e1af9eb22
|
@ -160,10 +160,12 @@ rb_connection_initialize(VALUE self, VALUE rb_servers)
|
|||
static VALUE
|
||||
rb_connection_clone(VALUE self)
|
||||
{
|
||||
VALUE clone = rb_obj_clone(self);
|
||||
memcached_ctx *ctx = get_ctx(clone);
|
||||
ctx->memc = memcached_clone(NULL, ctx->memc);
|
||||
return clone;
|
||||
memcached_st * memc;
|
||||
memcached_ctx *ctx = get_ctx(self);
|
||||
memc = memcached_clone(NULL, ctx->memc);
|
||||
VALUE rb_obj = Data_Make_Struct(rb_cConnection, memcached_ctx, NULL, free_memc, ctx);
|
||||
ctx->memc = memc;
|
||||
return rb_obj;
|
||||
}
|
||||
|
||||
static memcached_return_t
|
||||
|
|
|
@ -140,6 +140,7 @@ class ClientTest < BaseTest
|
|||
assert_equal cache.servers, @cache.servers
|
||||
refute_equal cache, @cache
|
||||
|
||||
refute_nil cache.connection.servers
|
||||
# Definitely check that the connections are unlinked
|
||||
refute_equal @cache.connection.object_id, cache.connection.object_id
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче