X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fbehavior.c;h=6d1688601ce6f552463c139b05329008f1cdb9d7;hb=77e8ed0b8644b5d6bdd5ce46f48976671e1c04d4;hp=4813a3b815d899445dd8fe1585e4ce77af3542de;hpb=e7561db4b56f2e78948710a0f360f65f5703a8e6;p=awesomized%2Flibmemcached diff --git a/libmemcached/behavior.c b/libmemcached/behavior.c index 4813a3b8..6d168860 100644 --- a/libmemcached/behavior.c +++ b/libmemcached/behavior.c @@ -252,13 +252,16 @@ uint64_t memcached_behavior_get(memcached_st *ptr, { int sock_size; socklen_t sock_length= sizeof(int); + memcached_server_instance_st *instance; + + instance= memcached_server_instance_fetch(ptr, 0); /* REFACTOR */ /* We just try the first host, and if it is down we return zero */ - if ((memcached_connect(&ptr->hosts[0])) != MEMCACHED_SUCCESS) + if ((memcached_connect(instance)) != MEMCACHED_SUCCESS) return 0; - if (getsockopt(ptr->hosts[0].fd, SOL_SOCKET, + if (getsockopt(instance->fd, SOL_SOCKET, SO_SNDBUF, &sock_size, &sock_length)) return 0; /* Zero means error */ @@ -268,15 +271,18 @@ uint64_t memcached_behavior_get(memcached_st *ptr, { int sock_size; socklen_t sock_length= sizeof(int); + memcached_server_instance_st *instance; + + instance= memcached_server_instance_fetch(ptr, 0); /** @note REFACTOR */ /* We just try the first host, and if it is down we return zero */ - if ((memcached_connect(&ptr->hosts[0])) != MEMCACHED_SUCCESS) + if ((memcached_connect(instance)) != MEMCACHED_SUCCESS) return 0; - if (getsockopt(ptr->hosts[0].fd, SOL_SOCKET, + if (getsockopt(instance->fd, SOL_SOCKET, SO_RCVBUF, &sock_size, &sock_length)) return 0; /* Zero means error */