Change hosts over to realloc array
[awesomized/libmemcached] / lib / memcached_storage.c
index 5ed2fd557e79099457ff4cb11363688b4a4658a7..40d36394234f024d892ddd1fff142cdc5c20aa4d 100644 (file)
@@ -28,7 +28,7 @@ static memcached_return memcached_send(memcached_st *ptr,
   send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
                         "%s %.*s %u %u %u\r\n", verb,
                         key_length, key, flags, expiration, value_length);
-  if ((send(ptr->fd, buffer, send_length, 0) == -1))
+  if ((send(ptr->hosts[0].fd, buffer, send_length, 0) == -1))
   {
     fprintf(stderr, "failed set on %.*s TCP\n", key_length+1, key);
 
@@ -38,14 +38,14 @@ static memcached_return memcached_send(memcached_st *ptr,
   send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, 
                         "%.*s\r\n", 
                         value_length, value);
-  if ((send(ptr->fd, buffer, send_length, 0) == -1))
+  if ((send(ptr->hosts[0].fd, buffer, send_length, 0) == -1))
   {
     fprintf(stderr, "failed set on %.*s TCP\n", key_length+1, key);
 
     return MEMCACHED_WRITE_FAILURE;
   }
   
-  send_length= read(ptr->fd, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE);
+  send_length= read(ptr->hosts[0].fd, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE);
 
   if (send_length && buffer[0] == 'S')  /* STORED */
     return MEMCACHED_SUCCESS;