if (load_key)
{
memset(key, 0, MEMCACHED_MAX_KEY);
+ *key_length= 0;
+
for (; end_ptr == string_ptr || *string_ptr != ' '; string_ptr++)
{
*key= *string_ptr;
key++;
+ (*key_length)++;
}
}
else /* Skip characters */
send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, "get %.*s\r\n",
(int)key_length, key);
- if ((send(ptr->hosts[server_key].fd, buffer, send_length, 0) == -1))
+
+ if ((memcached_io_write(ptr, server_key, buffer, send_length, 1)) == -1)
{
*error= MEMCACHED_WRITE_FAILURE;
goto error;
memcached_string_st *string= cursor_key_exec[x];
memcached_string_append(ptr, string, "\r\n", 2);
- if ((send(ptr->hosts[x].fd, string->string,
- memcached_string_length(ptr, string), 0) == -1))
+ if ((memcached_io_write(ptr, x, string->string,
+ memcached_string_length(ptr, string), 1)) == -1)
{
memcached_quit(ptr);
rc= MEMCACHED_SOME_ERRORS;