2 +--------------------------------------------------------------------+
3 | libmemcached - 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 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
23 # define MEMCACHED_NI_MAXHOST NI_MAXHOST
25 # define MEMCACHED_NI_MAXHOST 1025
29 # define MEMCACHED_NI_MAXSERV NI_MAXSERV
31 # define MEMCACHED_NI_MAXSERV 32
34 enum memcached_server_state_t
{
35 MEMCACHED_SERVER_STATE_NEW
, // fd == -1, no address lookup has been done
36 MEMCACHED_SERVER_STATE_ADDRINFO
, // ADDRRESS information has been gathered
37 MEMCACHED_SERVER_STATE_IN_PROGRESS
,
38 MEMCACHED_SERVER_STATE_CONNECTED
,
39 MEMCACHED_SERVER_STATE_IN_TIMEOUT
,
40 MEMCACHED_SERVER_STATE_DISABLED
43 struct memcached_server_st
{
45 bool is_allocated
: 1;
46 bool is_initialized
: 1;
47 bool is_shutting_down
: 1;
50 uint32_t number_of_hosts
;
51 uint32_t cursor_active
;
53 uint32_t io_bytes_sent
; /* # bytes sent since last read */
55 uint32_t server_failure_counter
;
56 uint64_t server_failure_counter_query_id
;
57 uint32_t server_timeout_counter
;
58 uint64_t server_timeout_counter_query_id
;
61 enum memcached_server_state_t state
;
68 uint8_t major_version
; // Default definition of UINT8_MAX means that it has not been set.
69 uint8_t micro_version
; // ditto, and note that this is the third, not second version bit
70 uint8_t minor_version
; // ditto
71 memcached_connection_t type
;
73 struct memcached_st
*root
;
74 uint64_t limit_maxbytes
;
75 struct memcached_error_t
*error_messages
;
76 char hostname
[MEMCACHED_NI_MAXHOST
];