{
struct addrinfo *use;
+ WATCHPOINT_ASSERT(ptr->cursor_active == 0);
+
if (!ptr->sockaddr_inited ||
(!(ptr->root->flags.use_cache_lookups)))
{
if (ptr->fd != -1)
{
- WATCHPOINT_ASSERT(ptr->cursor_active == 0);
ptr->server_failure_counter= 0;
return MEMCACHED_SUCCESS;
}
}
else
{
+ /* ensure that we are connected, otherwise we might bump the
+ * command counter before connection */
+ if ((rc= memcached_connect(&ptr->hosts[server_key])) != MEMCACHED_SUCCESS)
+ {
+ WATCHPOINT_ERROR(rc);
+ return rc;
+ }
+
if (ptr->hosts[server_key].minor_version == 0)
{
if (no_reply || !to_write)