Fix for most errors around non-block
[m6w6/libmemcached] / libmemcached / memcached_connect.c
index 2b392fb6138528361abb5836f9e3d628fcface76..4cd5219afebabb90689bb6c1fcf6e5a749138cb6 100644 (file)
@@ -184,8 +184,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)))
@@ -236,7 +234,7 @@ test_connect:
             {
               goto handle_retry;
             }
-            else if (error != 1 || fds[0].revents & POLLERR)
+            else if (error != 1 && fds[0].revents & POLLERR)
             {
               ptr->cached_errno= errno;
               WATCHPOINT_ERRNO(ptr->cached_errno);