Destroy orphan connections on I/O. We could perhaps do better, to preserve
[pazpar2-moved-to-github.git] / pazpar2.c
index 1c43633..d01a024 100644 (file)
--- a/pazpar2.c
+++ b/pazpar2.c
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.c,v 1.14 2006-12-17 13:42:47 quinn Exp $ */;
+/* $Id: pazpar2.c,v 1.16 2006-12-18 16:29:57 quinn Exp $ */;
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -713,6 +713,12 @@ static void handler(IOCHAN i, int event)
 
     if (cl)
         se = cl->session;
+    else
+    {
+        yaz_log(YLOG_WARN, "Destroying orphan connection (fix me?)");
+        connection_destroy(co);
+        return;
+    }
 
     if (co->state == Conn_Connecting && event & EVENT_OUTPUT)
     {
@@ -976,7 +982,7 @@ void load_simpletargets(const char *fn)
             continue;
         url = line + 7;
         url[strlen(url) - 1] = '\0';
-        yaz_log(LOG_DEBUG, "Target: %s", url);
+        yaz_log(YLOG_DEBUG, "Target: %s", url);
         if ((db = strchr(url, '/')))
             *(db++) = '\0';
         else