- if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE)
- return MEMCACHED_WRITE_FAILURE;
-
- sent_length= write(ptr->hosts[x].fd, buffer, send_length);
-
- if (sent_length == -1)
- {
- fprintf(stderr, "error %s: write: %m\n", __FUNCTION__);
- return MEMCACHED_WRITE_FAILURE;
- }
-
- if (sent_length != send_length)
- {
- fprintf(stderr, "error %s: short write %d %d: %m\n",
- __FUNCTION__, sent_length, send_length);
- return MEMCACHED_WRITE_FAILURE;
- }
-
- rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, x);
+ rc= memcached_do(&ptr->hosts[x], buffer, send_length, 1);