Incomming fix from Chris
[m6w6/libmemcached] / libmemcached / memcached_connect.c
index 57bce10107255bbef5c00a3506b6fd9c7a2a709d..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;
 }