{
memcached_return_t unused;
if (error == NULL)
+ {
error= &unused;
+ }
- unlikely (ptr->flags.use_udp)
+ if (ptr->flags.use_udp)
{
if (value_length)
+ {
*value_length= 0;
+ }
*error= memcached_set_error(*ptr, MEMCACHED_NOT_SUPPORTED, MEMCACHED_AT);
return NULL;
struct libmemcached_io_vector_st vector[]=
{
- { get_command_length, get_command },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] },
- { 1, " " }
+ { get_command, get_command_length },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] },
+ { memcached_literal_param(" ") }
};
unsigned int number_of_callbacks)
{
if ((ptr->flags.binary_protocol) == 0)
+ {
return MEMCACHED_NOT_SUPPORTED;
+ }
memcached_return_t rc;
memcached_callback_st *original_callbacks= ptr->callbacks;
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] }
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] }
};
if (memcached_io_writev(instance, vector, 3, flush) == -1)
*/
struct libmemcached_io_vector_st vector[]=
{
- { sizeof(request.bytes), request.bytes },
- { memcached_array_size(ptr->_namespace), memcached_array_string(ptr->_namespace) },
- { key_length[x], keys[x] }
+ { request.bytes, sizeof(request.bytes) },
+ { memcached_array_string(ptr->_namespace), memcached_array_size(ptr->_namespace) },
+ { keys[x], key_length[x] }
};
if (memcached_io_writev(instance, vector, 3, true) == -1)
}
if (success)
+ {
break;
+ }
}
return rc;
keys, key_length, number_of_keys, mget_mode);
}
- uint32_t* hash= static_cast<uint32_t*>(libmemcached_malloc(ptr, sizeof(uint32_t) * number_of_keys));
- bool* dead_servers= static_cast<bool*>(libmemcached_calloc(ptr, memcached_server_count(ptr), sizeof(bool)));
+ uint32_t* hash= libmemcached_xvalloc(ptr, number_of_keys, uint32_t);
+ bool* dead_servers= libmemcached_xcalloc(ptr, memcached_server_count(ptr), bool);
if (hash == NULL || dead_servers == NULL)
{