3 memcached_return
memcached_fetch_execute(memcached_st
*ptr
,
4 memcached_execute_function
*callback
,
6 unsigned int number_of_callbacks
)
8 memcached_result_st
*result
= &ptr
->result
;
10 while (ptr
->cursor_server
< ptr
->number_of_hosts
)
14 char buffer
[MEMCACHED_DEFAULT_COMMAND_SIZE
];
16 if (memcached_server_response_count(&ptr
->hosts
[ptr
->cursor_server
]) == 0)
22 rc
= memcached_response(&ptr
->hosts
[ptr
->cursor_server
], buffer
, MEMCACHED_DEFAULT_COMMAND_SIZE
, result
);
24 if (rc
== MEMCACHED_END
) /* END means that we move on to the next */
26 memcached_server_response_reset(&ptr
->hosts
[ptr
->cursor_server
]);
30 else if (rc
== MEMCACHED_SUCCESS
)
34 for (x
= 0; x
< number_of_callbacks
; x
++)
36 memcached_return iferror
;
38 iferror
= (*callback
[x
])(ptr
, result
, context
);
40 if (iferror
!= MEMCACHED_SUCCESS
)
46 return MEMCACHED_SUCCESS
;