#define memcached_server_response_decrement(A) (A)->cursor_active--
#define memcached_server_response_reset(A) (A)->cursor_active=0
-LIBMEMCACHED_LOCAL
-memcached_return_t memcached_purge(memcached_server_write_instance_st ptr);
+bool memcached_purge(memcached_server_write_instance_st ptr);
#ifdef __cplusplus
}
*/
if (read_or_write == MEM_WRITE)
{
- if (memcached_fatal(memcached_purge(ptr)))
+ if (memcached_purge(ptr) == false)
{
return MEMCACHED_FAILURE;
}
*/
{
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
- memcached_return_t rc= memcached_purge(ptr);
- if (rc != MEMCACHED_SUCCESS and rc != MEMCACHED_STORED)
+ if (memcached_purge(ptr) == false)
{
return false;
}
#include <libmemcached/common.h>
-memcached_return_t memcached_purge(memcached_server_write_instance_st ptr)
+bool memcached_purge(memcached_server_write_instance_st ptr)
{
- memcached_return_t ret= MEMCACHED_SUCCESS;
memcached_st *root= (memcached_st *)ptr->root;
if (memcached_is_purging(ptr->root) || /* already purging */
(ptr->io_bytes_sent >= ptr->root->io_bytes_watermark &&
memcached_server_response_count(ptr) < 2))
{
- return MEMCACHED_SUCCESS;
+ return true;
}
/*
{
memcached_set_purging(root, true);
- return memcached_set_error(*ptr, MEMCACHED_WRITE_FAILURE, MEMCACHED_AT);
+ memcached_set_error(*ptr, MEMCACHED_WRITE_FAILURE, MEMCACHED_AT);
+ return false;
}
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
+ bool is_successful= true;
uint32_t no_msg= memcached_server_response_count(ptr) - 1;
if (no_msg > 0)
{
{
WATCHPOINT_ERROR(rc);
memcached_io_reset(ptr);
- ret= rc;
-#if 0
- ret= memcached_set_error(*ptr, rc, MEMCACHED_AT);
-#endif
+ is_successful= false;
}
if (ptr->root->callbacks != NULL)
}
memcached_set_purging(root, false);
- return ret;
+ return is_successful;
}