#include "common.h"
#include <time.h>
#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/tcp.h>
static bool set_flag(uint64_t data)
{
ptr->server_failure_limit= (uint32_t)data;
break;
case MEMCACHED_BEHAVIOR_BINARY_PROTOCOL:
+ memcached_quit(ptr); // We need t shutdown all of the connections to make sure we do the correct protocol
if (data)
{
ptr->flags.verify_key= false;
ptr->recv_size= (int32_t)data;
memcached_quit(ptr);
break;
+ case MEMCACHED_BEHAVIOR_TCP_KEEPIDLE:
+ ptr->tcp_keepidle= (uint32_t)data;
+ memcached_quit(ptr);
+ break;
case MEMCACHED_BEHAVIOR_USER_DATA:
return MEMCACHED_FAILURE;
case MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY:
return MEMCACHED_SUCCESS;
}
-inline bool _is_auto_eject_host(const memcached_st *ptr)
+bool _is_auto_eject_host(const memcached_st *ptr)
{
return ptr->flags.auto_eject_hosts;
}
return (uint64_t)ptr->snd_timeout;
case MEMCACHED_BEHAVIOR_RCV_TIMEOUT:
return (uint64_t)ptr->rcv_timeout;
+ case MEMCACHED_BEHAVIOR_TCP_KEEPIDLE:
+ return (uint64_t)ptr->tcp_keepidle;
case MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE:
{
int sock_size= 0;