Add a request id for each request that hits the wire.
[m6w6/libmemcached] / libmemcached / server.cc
index f2f78211fe35beedb73ce138f64d4e950cf97677..9345da0b3a28eb1957e7bc19d33473ea95d94e4b 100644 (file)
@@ -52,12 +52,14 @@ static inline void _server_init(memcached_server_st *self, memcached_st *root,
   self->port= port;
   self->fd= INVALID_SOCKET;
   self->io_bytes_sent= 0;
+  self->request_id= 0;
   self->server_failure_counter= 0;
   self->server_failure_counter_query_id= 0;
   self->weight= weight ? weight : 1; // 1 is the default weight value
   self->io_wait_count.read= 0;
   self->io_wait_count.write= 0;
   self->io_wait_count.timeouts= 0;
+  self->io_wait_count._bytes_read= 0;
   self->major_version= UINT8_MAX;
   self->micro_version= UINT8_MAX;
   self->minor_version= UINT8_MAX;
@@ -352,7 +354,9 @@ in_port_t memcached_server_port(const memcached_server_instance_st self)
 {
   WATCHPOINT_ASSERT(self);
   if (self == NULL)
+  {
     return 0;
+  }
 
   return self->port;
 }
@@ -361,7 +365,9 @@ uint32_t memcached_server_response_count(const memcached_server_instance_st self
 {
   WATCHPOINT_ASSERT(self);
   if (self == NULL)
+  {
     return 0;
+  }
 
   return self->cursor_active;
 }