/*
+--------------------------------------------------------------------+
- | libmemcached - C/C++ Client Library for memcached |
+ | libmemcached-awesome - C/C++ Client Library for memcached |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted under the terms of the BSD license. |
| the terms online at: https://opensource.org/licenses/BSD-3-Clause |
+--------------------------------------------------------------------+
| Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
- | Copyright (c) 2020 Michael Wallner <mike@php.net> |
+ | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ |
+--------------------------------------------------------------------+
*/
#include "libmemcached/common.h"
#include "libmemcached/assert.hpp"
+#include "p9y/gettimeofday.hpp"
+#include "p9y/random.hpp"
#include <cmath>
-#if HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#include <time.h>
/* Protoypes (static) */
static memcached_return_t update_continuum(Memcached *ptr);
memcached_instance_st *instance =
memcached_instance_fetch(memc, memcached_server_count(memc) - 1);
- if (__instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
+ if (instance_create_with(memc, instance, hostname, port, weight, type) == NULL) {
return memcached_set_error(*memc, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
}
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname = {memcached_string_make_from_cstr(list[x].hostname)};
- if (__instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight,
- list[x].type)
+ if (instance_create_with(ptr, instance, hostname, list[x].port, list[x].weight, list[x].type)
== NULL)
{
ptr->state.is_parsing = false;
WATCHPOINT_ASSERT(instance);
memcached_string_t hostname = {memcached_string_make_from_cstr(list[x]._hostname)};
- if (__instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight,
- list[x].type)
+ if (instance_create_with(ptr, instance, hostname, list[x].port(), list[x].weight, list[x].type)
== NULL)
{
ptr->state.is_parsing = false;