From: Brian Aker Date: Sun, 3 Jan 2010 01:07:52 +0000 (-0800) Subject: Moved init for socket to options. X-Git-Tag: 0.37~35 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=0c7d432ca4a89f23caa74ff11e5a63fa9e6d3f3f;p=m6w6%2Flibmemcached Moved init for socket to options. --- diff --git a/libmemcached/connect.c b/libmemcached/connect.c index e58e37fc..36971f60 100644 --- a/libmemcached/connect.c +++ b/libmemcached/connect.c @@ -210,7 +210,7 @@ static memcached_return_t network_connect(memcached_server_st *ptr) WATCHPOINT_ASSERT(ptr->cursor_active == 0); - if (!ptr->sockaddr_inited || + if (! ptr->options.sockaddr_inited || (!(ptr->root->flags.use_cache_lookups))) { memcached_return_t rc; @@ -218,7 +218,7 @@ static memcached_return_t network_connect(memcached_server_st *ptr) rc= set_hostinfo(ptr); if (rc != MEMCACHED_SUCCESS) return rc; - ptr->sockaddr_inited= true; + ptr->options.sockaddr_inited= true; } use= ptr->address_info; diff --git a/libmemcached/hosts.c b/libmemcached/hosts.c index e0224222..5ce4b70d 100644 --- a/libmemcached/hosts.c +++ b/libmemcached/hosts.c @@ -323,7 +323,7 @@ memcached_return_t memcached_server_push(memcached_st *ptr, memcached_server_st new_host_list= ptr->call_realloc(ptr, ptr->hosts, sizeof(memcached_server_st) * (count + ptr->number_of_hosts)); - if (!new_host_list) + if (! new_host_list) return MEMCACHED_MEMORY_ALLOCATION_FAILURE; ptr->hosts= new_host_list; diff --git a/libmemcached/server.c b/libmemcached/server.c index 814962c7..42abda2d 100644 --- a/libmemcached/server.c +++ b/libmemcached/server.c @@ -1,5 +1,5 @@ /* LibMemcached - * Copyright (C) 2006-2009 Brian Aker + * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See @@ -94,9 +94,9 @@ memcached_server_st *memcached_server_clone(memcached_server_st *clone, memcache if (ptr == NULL) return NULL; - rv = memcached_server_create_with(ptr->root, clone, - ptr->hostname, ptr->port, ptr->weight, - ptr->type); + rv= memcached_server_create_with(ptr->root, clone, + ptr->hostname, ptr->port, ptr->weight, + ptr->type); if (rv != NULL) { rv->cached_errno= ptr->cached_errno; diff --git a/libmemcached/server.h b/libmemcached/server.h index 66a23a56..d8e9daa8 100644 --- a/libmemcached/server.h +++ b/libmemcached/server.h @@ -1,5 +1,5 @@ /* LibMemcached - * Copyright (C) 2006-2009 Brian Aker + * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See @@ -19,8 +19,8 @@ extern "C" { struct memcached_server_st { struct { bool is_allocated:1; + bool sockaddr_inited:1; } options; - bool sockaddr_inited; uint16_t count; uint32_t cursor_active; in_port_t port;