- uint32_t server_key;
- memcached_server_write_instance_st instance;
- bool no_reply= ptr->flags.no_reply;
-
- if (ptr->flags.verify_key && (memcached_key_test((const char **)&key, &key_length, 1) == MEMCACHED_BAD_KEY_PROVIDED))
- return MEMCACHED_BAD_KEY_PROVIDED;
-
- server_key= memcached_generate_hash_with_redistribution(ptr, group_key, group_key_length);
- instance= memcached_server_instance_fetch(ptr, server_key);
-
- int send_length;
- send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
- "%s %.*s%.*s %" PRIu64 "%s\r\n", verb,
- memcached_print_array(ptr->prefix_key),
- (int)key_length, key,
- offset, no_reply ? " noreply" : "");
- if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
- return MEMCACHED_WRITE_FAILURE;
-
- rc= memcached_do(instance, buffer, (size_t)send_length, true);
- if (no_reply || rc != MEMCACHED_SUCCESS)
- return rc;