-/* $Id: logic.c,v 1.15 2007-04-20 16:37:35 quinn Exp $
+/* $Id: logic.c,v 1.16 2007-04-21 12:00:54 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
}
}
-static void handler(IOCHAN i, int event)
+void connection_handler(IOCHAN i, int event)
{
struct connection *co = iochan_getdata(i);
struct client *cl = co->client;
connection_freelist = co;
}
+
// Creates a new connection for client, associated with the host of
// client's database
static struct connection *connection_create(struct client *cl)
void *addr;
+ if (!cl->database->database->host->ipport)
+ {
+ yaz_log(YLOG_WARN, "Not yet resolved: %s",
+ cl->database->database->url);
+ return 0;
+ }
+
if (!(link = cs_create(tcpip_type, 0, PROTO_Z3950)))
{
yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to create comstack");
cl->connection = new;
new->link = link;
- new->iochan = iochan_create(cs_fileno(link), handler, 0);
+ new->iochan = iochan_create(cs_fileno(link), connection_handler, 0);
iochan_setdata(new->iochan, new);
pazpar2_add_channel(new->iochan);
return new;