X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=lib%2Fmemcached.c;h=24c3b8bc4048198c60e10e581f371461490a3563;hb=cfe8176feba42fc63e8f627f9ac613a12a368b92;hp=591bf1f669cf8574e2c5c03bda3f5198ff55b7f8;hpb=ce94a18ec36e050c0afb49a8c6fba022e5bb82ee;p=m6w6%2Flibmemcached diff --git a/lib/memcached.c b/lib/memcached.c index 591bf1f6..24c3b8bc 100644 --- a/lib/memcached.c +++ b/lib/memcached.c @@ -5,7 +5,7 @@ memcached_st *memcached_create(memcached_st *ptr) { - memcached_string_st *string_ptr; + memcached_result_st *result_ptr; if (!ptr) { ptr= (memcached_st *)malloc(sizeof(memcached_st)); @@ -20,10 +20,10 @@ memcached_st *memcached_create(memcached_st *ptr) { memset(ptr, 0, sizeof(memcached_st)); } - string_ptr= memcached_string_create(ptr, &ptr->result_buffer, 0); - WATCHPOINT_ASSERT(string_ptr); - ptr->poll_timeout= -1; - ptr->distribution= MEMCACHED_DISTRIBUTION_MODULO; + result_ptr= memcached_result_create(ptr, &ptr->result); + WATCHPOINT_ASSERT(result_ptr); + ptr->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT; + ptr->distribution= MEMCACHED_DISTRIBUTION_MODULA; return ptr; } @@ -33,7 +33,7 @@ void memcached_free(memcached_st *ptr) /* If we have anything open, lets close it now */ memcached_quit(ptr); memcached_server_list_free(ptr->hosts); - memcached_string_free(&ptr->result_buffer); + memcached_result_free(&ptr->result); if (ptr->is_allocated == MEMCACHED_ALLOCATED) free(ptr); @@ -81,6 +81,7 @@ memcached_st *memcached_clone(memcached_st *clone, memcached_st *ptr) new_clone->recv_size= ptr->recv_size; new_clone->poll_timeout= ptr->poll_timeout; new_clone->distribution= ptr->distribution; + new_clone->hash= ptr->hash; return new_clone; }