ZOOM C: tweak when connection failed is returned
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 7 Oct 2015 14:04:43 +0000 (16:04 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 7 Oct 2015 14:04:43 +0000 (16:04 +0200)
For cases with multiple socket addresses for some hostname, eg
localhost IPV4+IPV6, the code now properly returns "connection
failed" rather than "connection lost".

src/zoom-c.c

index 3e5d647..5c62a07 100644 (file)
@@ -2004,7 +2004,8 @@ static void ZOOM_connection_do_io(ZOOM_connection c, int mask)
                 else
                     ZOOM_connection_exec_task(c);
             }
-            c->state = STATE_ESTABLISHED;
+            if (c->cs && cs_look(c->cs) == CS_DATA)
+                c->state = STATE_ESTABLISHED;
         }
         else
         {