Fix for non-threaded resolver.
[pazpar2-moved-to-github.git] / src / connection.c
index 979f739..493d19d 100644 (file)
@@ -42,12 +42,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include <yaz/comstack.h>
 #include <yaz/tcpip.h>
 #include "connection.h"
-#include "eventl.h"
 #include "pazpar2.h"
 #include "host.h"
 #include "client.h"
 #include "settings.h"
-#include "parameters.h"
 
 
 /** \brief Represents a physical, reusable  connection to a remote Z39.50 host
@@ -400,8 +398,6 @@ static int connection_connect(struct connection *con)
     /* this fragment is bad DRY: from client_prep_connection */
     client_set_state(con->client, Client_Connecting);
     ZOOM_options_destroy(zoptions);
-    // This creates the connection
-    ZOOM_connection_process(link);
     return 0;
 }
 
@@ -423,6 +419,9 @@ int client_prep_connection(struct client *cl,
     if (zproxy && zproxy[0] == '\0')
         zproxy = 0;
 
+    if (!host)
+        return 0;
+
     co = client_get_connection(cl);
 
     yaz_log(YLOG_DEBUG, "Client prep %s", client_get_url(cl));