messages.
memcached_hash hash;
memcached_server_distribution distribution;
unsigned int wheel[MEMCACHED_WHEEL_SIZE];
+#ifdef NOT_USED /* Future Use */
uint8_t replicas;
- memcached_return warning; /* Future Use */
+ memcached_return warning;
+#endif
};
/* Public API */
if ((ptr->flags & MEM_NO_BLOCK))
{
rc= MEMCACHED_SUCCESS;
- memcached_server_response_increment(ptr, server_key);
}
else
{
if (sent_length == -1 || sent_length != command_length)
rc= MEMCACHED_WRITE_FAILURE;
+ else
+ memcached_server_response_increment(ptr, server_key);
return rc;
}
rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
-
if (rc == MEMCACHED_SUCCESS)
{
char *next_ptr;
rc= MEMCACHED_SOME_ERRORS;
continue;
}
- ptr->hosts[server_key].cursor_active= 1;
+ ptr->hosts[server_key].cursor_active++;
}
if ((memcached_io_write(ptr, server_key, keys[x], key_length[x], 0)) == -1)
*/
for (x= 0; x < ptr->number_of_hosts; x++)
{
- if (ptr->hosts[x].cursor_active == 1)
+ if (ptr->hosts[x].cursor_active)
{
/* We need to doo something about non-connnected hosts in the future */
if ((memcached_io_write(ptr, x, "\r\n", 2, 1)) == -1)
{
rc= MEMCACHED_SOME_ERRORS;
}
+ memcached_server_response_increment(ptr, x);
}
}
send_length= 0;
max_messages= memcached_server_response_count(ptr, server_key);
- for (x= 0; x <= max_messages; x++)
+ for (x= 0; x < max_messages; x++)
{
size_t total_length= 0;
buffer_ptr= buffer;
buffer_ptr++;
*buffer_ptr= 0;
- if (memcached_server_response_count(ptr, server_key))
- memcached_server_response_decrement(ptr, server_key);
+ memcached_server_response_decrement(ptr, server_key);
}
switch(buffer[0])
{
case 'V': /* VALUE || VERSION */
- return MEMCACHED_SUCCESS;
+ if (buffer[1] == 'A') /* VALUE */
+ {
+ /* We add back in one because we will need to search for END */
+ memcached_server_response_increment(ptr, server_key);
+ return MEMCACHED_SUCCESS;
+ }
+ else if (buffer[1] == 'E') /* VERSION */
+ {
+ return MEMCACHED_SUCCESS;
+ }
+ else
+ {
+ WATCHPOINT_STRING(buffer);
+ WATCHPOINT_ASSERT(0);
+ return MEMCACHED_UNKNOWN_READ_FAILURE;
+ }
case 'O': /* OK */
return MEMCACHED_SUCCESS;
case 'S': /* STORED STATS SERVER_ERROR */
{
if (buffer[2] == 'A') /* STORED STATS */
+ {
+ memcached_server_response_increment(ptr, server_key);
return MEMCACHED_STAT;
+ }
else if (buffer[1] == 'E')
return MEMCACHED_SERVER_ERROR;
else if (buffer[1] == 'T')
return MEMCACHED_STORED;
else
+ {
+ WATCHPOINT_STRING(buffer);
+ WATCHPOINT_ASSERT(0);
return MEMCACHED_UNKNOWN_READ_FAILURE;
+ }
}
case 'D': /* DELETED */
return MEMCACHED_DELETED;
}
if (to_write == 0)
- {
rc= MEMCACHED_SUCCESS;
- memcached_server_response_increment(ptr, server_key);
- }
else
- {
rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, server_key);
- }
+
if (rc == MEMCACHED_STORED)
return MEMCACHED_SUCCESS;
else