{
struct libmemcached_io_vector_st vector[]=
{
- { sizeof("add ") -1, "add " },
- { memcached_array_size(memc->_namespace), memcached_array_string(memc->_namespace) },
- { key_length, key },
- { sizeof(" 0") -1, " 0" },
- { sizeof(" 2678400") -1, " 2678400" },
- { sizeof(" 0") -1, " 0" },
- { 2, "\r\n" },
- { 2, "\r\n" }
+ { memcached_literal_param("add ") },
+ { memcached_array_string(memc->_namespace), memcached_array_size(memc->_namespace) },
+ { key, key_length },
+ { memcached_literal_param(" 0") },
+ { memcached_literal_param(" 2678400") },
+ { memcached_literal_param(" 0") },
+ { memcached_literal_param("\r\n") },
+ { memcached_literal_param("\r\n") }
};
/* Send command header */
rc= memcached_response(instance, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, NULL);
if (rc == MEMCACHED_NOTSTORED)
+ {
rc= MEMCACHED_SUCCESS;
+ }
if (rc == MEMCACHED_STORED)
+ {
rc= MEMCACHED_NOTFOUND;
+ }
}
if (rc == MEMCACHED_WRITE_FAILURE)
+ {
memcached_io_reset(instance);
+ }
return rc;
}
struct libmemcached_io_vector_st vector[]=
{
- { send_length, request.bytes },
- { memcached_array_size(memc->_namespace), memcached_array_string(memc->_namespace) },
- { key_length, key }
+ { request.bytes, send_length },
+ { memcached_array_string(memc->_namespace), memcached_array_size(memc->_namespace) },
+ { key, key_length }
};
/* write the header */