2 +--------------------------------------------------------------------+
3 | libmemcached-awesome - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ |
13 +--------------------------------------------------------------------+
18 #include "libmemcached-1.0/configure.h"
25 # define MEMCACHED_NI_MAXHOST NI_MAXHOST
27 # define MEMCACHED_NI_MAXHOST 1025
31 # define MEMCACHED_NI_MAXSERV NI_MAXSERV
33 # define MEMCACHED_NI_MAXSERV 32
36 enum memcached_server_state_t
{
37 MEMCACHED_SERVER_STATE_NEW
, // fd == -1, no address lookup has been done
38 MEMCACHED_SERVER_STATE_ADDRINFO
, // ADDRRESS information has been gathered
39 MEMCACHED_SERVER_STATE_IN_PROGRESS
,
40 MEMCACHED_SERVER_STATE_CONNECTED
,
41 MEMCACHED_SERVER_STATE_IN_TIMEOUT
,
42 MEMCACHED_SERVER_STATE_DISABLED
45 struct memcached_server_st
{
47 bool is_allocated
: 1;
48 bool is_initialized
: 1;
49 bool is_shutting_down
: 1;
52 uint32_t number_of_hosts
;
53 uint32_t cursor_active
;
55 uint32_t io_bytes_sent
; /* # bytes sent since last read */
57 uint32_t server_failure_counter
;
58 uint64_t server_failure_counter_query_id
;
59 uint32_t server_timeout_counter
;
60 uint64_t server_timeout_counter_query_id
;
63 enum memcached_server_state_t state
;
70 uint8_t major_version
; // Default definition of UINT8_MAX means that it has not been set.
71 uint8_t micro_version
; // ditto, and note that this is the third, not second version bit
72 uint8_t minor_version
; // ditto
73 memcached_connection_t type
;
75 struct memcached_st
*root
;
76 uint64_t limit_maxbytes
;
77 struct memcached_error_t
*error_messages
;
78 char hostname
[MEMCACHED_NI_MAXHOST
];