/* On all failure drop to returning NULL */
if (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED)
{
- uint8_t latch; /* We use latch to track the state of the original socket */
-
if (rc == MEMCACHED_BUFFERED)
{
+ uint8_t latch; /* We use latch to track the state of the original socket */
latch= memcached_behavior_get(ptr, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS);
if (latch == 0)
memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, 1);
- }
- rc= memcached_set(ptr, key, key_length,
- memcached_result_value(&ptr->result),
- memcached_result_length(&ptr->result),
- 0, memcached_result_flags(&ptr->result));
+ rc= memcached_set(ptr, key, key_length,
+ memcached_result_value(&ptr->result),
+ memcached_result_length(&ptr->result),
+ 0, memcached_result_flags(&ptr->result));
- if (rc == MEMCACHED_BUFFERED && latch == 0)
- memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, 0);
+ if (rc == MEMCACHED_BUFFERED && latch == 0)
+ memcached_behavior_set(ptr, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, 0);
+ }
+ else
+ {
+ rc= memcached_set(ptr, key, key_length,
+ memcached_result_value(&ptr->result),
+ memcached_result_length(&ptr->result),
+ 0, memcached_result_flags(&ptr->result));
+ }
if (rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED)
{
void memcached_io_reset(memcached_server_st *ptr);
ssize_t memcached_io_read(memcached_server_st *ptr,
char *buffer, size_t length);
-memcached_return memcached_io_close(memcached_server_st *ptr);
+memcached_return memcached_io_close(memcached_server_st *ptr, uint8_t io_death);