projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge branch 'catch' into v1.x
[awesomized/libmemcached]
/
src
/
libmemcached
/
hosts.cc
diff --git
a/src/libmemcached/hosts.cc
b/src/libmemcached/hosts.cc
index 98cb3f7d48dc777c1d4ca18f1c3f75b7a471f771..b8292b2b1d6712d6d4a5d4693a3628e00f0cba70 100644
(file)
--- a/
src/libmemcached/hosts.cc
+++ b/
src/libmemcached/hosts.cc
@@
-1,5
+1,5
@@
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
+ *
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
* Libmemcached library
*
* Copyright (C) 2011 Data Differential, http://datadifferential.com/
@@
-35,7
+35,7
@@
*
*/
*
*/
-#include
<libmemcached/common.h>
+#include
"libmemcached/common.h"
#include "libmemcached/assert.hpp"
#include <cmath>
#include "libmemcached/assert.hpp"
#include <cmath>
@@
-232,7
+232,7
@@
static memcached_return_t update_continuum(Memcached *ptr)
if (memcached_is_weighted_ketama(ptr))
{
float pct= (float)list[host_index].weight / (float)total_weight;
if (memcached_is_weighted_ketama(ptr))
{
float pct= (float)list[host_index].weight / (float)total_weight;
- pointer_per_server= (uint32_t) ((::floor((float) (pct * MEMCACHED_POINTS_PER_SERVER_KETAMA / 4 * (float)live_servers + 0.0000000001))) * 4);
+ pointer_per_server= (uint32_t) ((::floor((float) (pct * MEMCACHED_POINTS_PER_SERVER_KETAMA / 4 * (float)live_servers + 0.0000000001
F
))) * 4);
pointer_per_hash= 4;
if (0 && DEBUG)
{
pointer_per_hash= 4;
if (0 && DEBUG)
{
@@
-264,7
+264,7
@@
static memcached_return_t update_continuum(Memcached *ptr)
if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
{
if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
{
- return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
+ return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
memcached_literal_param("snprintf(sizeof(sort_host))"));
}
memcached_literal_param("snprintf(sizeof(sort_host))"));
}
@@
-317,7
+317,7
@@
static memcached_return_t update_continuum(Memcached *ptr)
if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
{
if (size_t(sort_host_length) >= sizeof(sort_host) or sort_host_length < 0)
{
- return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
+ return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT,
memcached_literal_param("snprintf(sizeof(sort_host)))"));
}
memcached_literal_param("snprintf(sizeof(sort_host)))"));
}
@@
-359,7
+359,7
@@
static memcached_return_t update_continuum(Memcached *ptr)
return MEMCACHED_SUCCESS;
}
return MEMCACHED_SUCCESS;
}
-static memcached_return_t server_add(Memcached *memc,
+static memcached_return_t server_add(Memcached *memc,
const memcached_string_t& hostname,
in_port_t port,
uint32_t weight,
const memcached_string_t& hostname,
in_port_t port,
uint32_t weight,
@@
-441,7
+441,7
@@
memcached_return_t memcached_server_push(memcached_st *shell, const memcached_se
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname= { memcached_string_make_from_cstr(list[x].hostname) };
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname= { memcached_string_make_from_cstr(list[x].hostname) };
- if (__instance_create_with(ptr, instance,
+ if (__instance_create_with(ptr, instance,
hostname,
list[x].port, list[x].weight, list[x].type) == NULL)
{
hostname,
list[x].port, list[x].weight, list[x].type) == NULL)
{
@@
-494,7
+494,7
@@
memcached_return_t memcached_instance_push(memcached_st *ptr, const struct memca
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname= { memcached_string_make_from_cstr(list[x]._hostname) };
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname= { memcached_string_make_from_cstr(list[x]._hostname) };
- if (__instance_create_with(ptr, instance,
+ if (__instance_create_with(ptr, instance,
hostname,
list[x].port(), list[x].weight, list[x].type) == NULL)
{
hostname,
list[x].port(), list[x].weight, list[x].type) == NULL)
{