if (ptr->root->purging || /* already purging */
(memcached_server_response_count(ptr) < ptr->root->io_msg_watermark &&
ptr->io_bytes_sent < ptr->root->io_bytes_watermark) ||
- (ptr->io_bytes_sent > ptr->root->io_bytes_watermark &&
+ (ptr->io_bytes_sent >= ptr->root->io_bytes_watermark &&
memcached_server_response_count(ptr) < 2))
{
return MEMCACHED_SUCCESS;
* data to be sent from the server (the commands was in the output buffer
* and just flushed
*/
- long timeo= ptr->root->poll_timeout;
+ int32_t timeo= ptr->root->poll_timeout;
ptr->root->poll_timeout= 2000;
result_ptr= memcached_result_create(ptr->root, &result);
ret = rc;
memcached_io_reset(ptr);
}
+
+ if (ptr->root->callbacks != NULL)
+ {
+ memcached_callback_st cb = *ptr->root->callbacks;
+ if (rc == MEMCACHED_SUCCESS)
+ {
+ for (unsigned int y = 0; y < cb.number_of_callback; y++)
+ {
+ rc = (*cb.callback[y])(ptr->root, result_ptr, cb.context);
+ if (rc != MEMCACHED_SUCCESS)
+ break;
+ }
+ }
+ }
}
memcached_result_free(result_ptr);
- ptr->root->poll_timeout=timeo;
+ ptr->root->poll_timeout= timeo;
}
ptr->root->purging= 0;