A number of small build fixes found while looking at mingw support.
[m6w6/libmemcached] / libmemcached-1.0 / struct / server.h
index b5bd1ca73718a0236ae839c55db57f7bc9e8e12b..33bdc0491eb8dd42b4a343812a4821f8efcd259b 100644 (file)
 
 #pragma once
 
-#ifndef WIN32
-#include <netdb.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
 #endif
 
 #ifdef NI_MAXHOST
-#define MEMCACHED_NI_MAXHOST NI_MAXHOST
+# define MEMCACHED_NI_MAXHOST NI_MAXHOST
 #else
-#define MEMCACHED_NI_MAXHOST 1025
+# define MEMCACHED_NI_MAXHOST 1025
 #endif
 
 #ifdef NI_MAXSERV
-#define MEMCACHED_NI_MAXSERV NI_MAXSERV
+# define MEMCACHED_NI_MAXSERV NI_MAXSERV
 #else
-#define MEMCACHED_NI_MAXSERV 32
+# define MEMCACHED_NI_MAXSERV 32
 #endif
 
 enum memcached_server_state_t {
@@ -59,7 +59,8 @@ enum memcached_server_state_t {
   MEMCACHED_SERVER_STATE_ADDRINFO, // ADDRRESS information has been gathered
   MEMCACHED_SERVER_STATE_IN_PROGRESS,
   MEMCACHED_SERVER_STATE_CONNECTED,
-  MEMCACHED_SERVER_STATE_IN_TIMEOUT
+  MEMCACHED_SERVER_STATE_IN_TIMEOUT,
+  MEMCACHED_SERVER_STATE_DISABLED
 };
 
 struct memcached_server_st {
@@ -72,8 +73,8 @@ struct memcached_server_st {
   uint32_t number_of_hosts;
   uint32_t cursor_active;
   in_port_t port;
-  memcached_socket_t fd;
   uint32_t io_bytes_sent; /* # bytes sent since last read */
+  uint32_t request_id;
   uint32_t server_failure_counter;
   uint64_t server_failure_counter_query_id;
   uint32_t weight;
@@ -89,17 +90,9 @@ struct memcached_server_st {
   uint8_t micro_version; // ditto, and note that this is the third, not second version bit
   uint8_t minor_version; // ditto
   memcached_connection_t type;
-  char *read_ptr;
-  size_t read_buffer_length;
-  size_t read_data_length;
-  size_t write_buffer_offset;
-  struct addrinfo *address_info;
-  struct addrinfo *address_info_next;
   time_t next_retry;
   struct memcached_st *root;
   uint64_t limit_maxbytes;
   struct memcached_error_t *error_messages;
-  char read_buffer[MEMCACHED_MAX_BUFFER];
-  char write_buffer[MEMCACHED_MAX_BUFFER];
   char hostname[MEMCACHED_NI_MAXHOST];
 };