- memset(buffer, 0, MEMCACHED_DEFAULT_COMMAND_SIZE);
+ /* Leaving this assert in since only a library fubar could blow this */
+#ifdef NOT_DONE
+ if (!(ptr->flags & MEM_NO_BLOCK) && ptr->write_buffer_offset != 0)
+ assert(0);
+#endif
+
+ server_key= memcached_generate_hash(ptr, key, key_length);
write_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"%s %.*s %x %llu %zu\r\n", storage_op_string(verb),
(int)key_length, key, flags,
write_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
"%s %.*s %x %llu %zu\r\n", storage_op_string(verb),
(int)key_length, key, flags,
We have to flush after sending the command. Memcached is not smart enough
to just keep reading from the socket :(
*/
We have to flush after sending the command. Memcached is not smart enough
to just keep reading from the socket :(
*/
- if ((sent_length= memcached_io_write(ptr, server_key, buffer, write_length, 1)) == -1)
+ if ((sent_length= memcached_io_write(ptr, server_key, buffer, write_length, 0)) == -1)
- if ((sent_length= memcached_io_write(ptr, server_key, "\r\n", 2, 1)) == -1)
+ if ((ptr->flags & MEM_NO_BLOCK) && verb == SET_OP)
+ to_write= 0;
+ else
+ to_write= 1;
+
+ if ((sent_length= memcached_io_write(ptr, server_key, "\r\n", 2, to_write)) == -1)