#include "common.h"
memcached_return memcached_fetch_execute(memcached_st *ptr,
- unsigned int (*callback[])(memcached_st *ptr, memcached_result_st *result, void *context),
+ memcached_execute_function *callback,
void *context,
unsigned int number_of_callbacks
)
char buffer[MEMCACHED_DEFAULT_COMMAND_SIZE];
- if (memcached_server_response_count(ptr, ptr->cursor_server) == 0)
+ if (memcached_server_response_count(&ptr->hosts[ptr->cursor_server]) == 0)
{
ptr->cursor_server++;
continue;
}
- rc= memcached_response(ptr, buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, result, ptr->cursor_server);
+ rc= memcached_response(&ptr->hosts[ptr->cursor_server], buffer, MEMCACHED_DEFAULT_COMMAND_SIZE, result);
if (rc == MEMCACHED_END) /* END means that we move on to the next */
{
- memcached_server_response_reset(ptr, ptr->cursor_server);
+ memcached_server_response_reset(&ptr->hosts[ptr->cursor_server]);
ptr->cursor_server++;
continue;
}
for (x= 0; x < number_of_callbacks; x++)
{
- unsigned int iferror;
+ memcached_return iferror;
iferror= (*callback[x])(ptr, result, context);
- if (iferror)
+ if (iferror != MEMCACHED_SUCCESS)
continue;
}
}