Incomming fix from Chris
[m6w6/libmemcached] / libmemcached / memcached_connect.c
index 2b392fb6138528361abb5836f9e3d628fcface76..429e8ec66f581488efbefa920181e31efcea05bb 100644 (file)
@@ -46,6 +46,8 @@ static memcached_return set_hostinfo(memcached_server_st *server)
 
 static memcached_return set_socket_options(memcached_server_st *ptr)
 {
+  WATCHPOINT_ASSERT(ptr->fd != -1);
+
   if (ptr->type == MEMCACHED_CONNECTION_UDP)
     return MEMCACHED_SUCCESS;
 
@@ -167,6 +169,8 @@ test_connect:
       }
     }
   }
+
+  WATCHPOINT_ASSERT(ptr->fd != -1);
   return MEMCACHED_SUCCESS;
 }
 
@@ -184,8 +188,6 @@ static memcached_return network_connect(memcached_server_st *ptr)
           return MEMCACHED_FAILURE;
       }
     }
-    /* Old connection junk still is in the structure */
-    WATCHPOINT_ASSERT(ptr->cursor_active == 0);
 
     if (ptr->sockaddr_inited == MEMCACHED_NOT_ALLOCATED || 
         (!(ptr->root->flags & MEM_USE_CACHE_LOOKUPS)))