Call cs_rcvconnect during redirect YAZ-754
[yaz-moved-to-github.git] / src / zoom-c.c
index 1bbac7e..37b87f9 100644 (file)
@@ -1064,7 +1064,7 @@ static zoom_ret do_connect_host(ZOOM_connection c, const char *logical_url)
 
     if (c->cs)
         cs_close(c->cs);
-    c->cs = cs_create_host_proxy(logical_url, 0, &add,
+    c->cs = cs_create_host_proxy(logical_url, CS_FLAGS_DNS_NO_BLOCK, &add,
                                  c->tproxy ? c->tproxy : c->proxy);
 
     if (c->cs && c->cs->protocol == PROTO_HTTP)
@@ -1563,6 +1563,7 @@ static void handle_http(ZOOM_connection c, Z_HTTP_Response *hres)
                                           location, &host_change);
             if (do_connect_host(c, location) == zoom_complete)
                 return;  /* connect failed.. */
+            cs_rcvconnect(c->cs);
             send_HTTP_redirect(c, location);
             return;
         }
@@ -1960,7 +1961,7 @@ static void ZOOM_connection_do_io(ZOOM_connection c, int mask)
             if (c->cs->io_pending & CS_WANT_READ)
                 mask += ZOOM_SELECT_READ;
             ZOOM_connection_set_mask(c, mask);
-            event = ZOOM_Event_create(ZOOM_EVENT_NONE);
+            event = ZOOM_Event_create(ZOOM_EVENT_CONNECT);
             ZOOM_connection_put_event(c, event);
         }
         else if (ret == 0)