places where this was accessed and always in the same way.
-/* $Id: http.c,v 1.27 2007-04-16 09:03:25 adam Exp $
+/* $Id: http.c,v 1.28 2007-04-19 16:07:20 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
// We will add EVENT_OUTPUT below
p->iochan = iochan_create(sock, proxy_io, EVENT_INPUT);
iochan_setdata(p->iochan, p);
- p->iochan->next = channel_list;
- channel_list = p->iochan;
+ pazpar2_add_channel(p->iochan);
}
// Do _not_ modify Host: header, just checking it's existence
ch->iochan = c;
iochan_setdata(c, ch);
- c->next = channel_list;
- channel_list = c;
+ pazpar2_add_channel(c);
}
/* Create a http-channel listener, syntax [host:]port */
yaz_log(YLOG_FATAL|YLOG_ERRNO, "listen");
c = iochan_create(l, http_accept, EVENT_INPUT | EVENT_EXCEPT);
- c->next = channel_list;
- channel_list = c;
+ pazpar2_add_channel(c);
}
void http_set_proxyaddr(char *host, char *base_url)
-/* $Id: http_command.c,v 1.39 2007-04-19 15:31:23 adam Exp $
+/* $Id: http_command.c,v 1.40 2007-04-19 16:07:20 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
*/
/*
- * $Id: http_command.c,v 1.39 2007-04-19 15:31:23 adam Exp $
+ * $Id: http_command.c,v 1.40 2007-04-19 16:07:20 adam Exp $
*/
#include <stdio.h>
r->timeout_iochan = iochan_create(-1, session_timeout, 0);
iochan_setdata(r->timeout_iochan, r);
iochan_settimeout(r->timeout_iochan, global_parameters.session_timeout);
- r->timeout_iochan->next = channel_list;
- channel_list = r->timeout_iochan;
+
+ pazpar2_add_channel(r->timeout_iochan);
return r;
}
-/* $Id: logic.c,v 1.9 2007-04-18 19:45:09 quinn Exp $
+/* $Id: logic.c,v 1.10 2007-04-19 16:07:20 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
static void ingest_records(struct client *cl, Z_Records *r);
void session_alert_watch(struct session *s, int what);
-IOCHAN channel_list = 0; // Master list of connections we're handling events to
-
static struct connection *connection_freelist = 0;
static struct client *client_freelist = 0;
new->iochan = iochan_create(cs_fileno(link), handler, 0);
iochan_setdata(new->iochan, new);
- new->iochan->next = channel_list;
- channel_list = new->iochan;
+ pazpar2_add_channel(new->iochan);
return new;
}
return;
}
+// Master list of connections we're handling events to
+static IOCHAN channel_list = 0;
+void pazpar2_add_channel(IOCHAN chan)
+{
+ chan->next = channel_list;
+ channel_list = chan;
+}
+void pazpar2_event_loop()
+{
+ event_loop(&channel_list);
+}
/*
* Local variables:
-/* $Id: pazpar2.c,v 1.79 2007-04-16 09:03:25 adam Exp $
+/* $Id: pazpar2.c,v 1.80 2007-04-19 16:07:20 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
global_parameters.odr_in = odr_createmem(ODR_DECODE);
global_parameters.odr_out = odr_createmem(ODR_ENCODE);
- event_loop(&channel_list);
+ pazpar2_event_loop();
return 0;
}
-/* $Id: pazpar2.h,v 1.25 2007-04-17 21:25:26 quinn Exp $
+/* $Id: pazpar2.h,v 1.26 2007-04-19 16:07:20 adam Exp $
Copyright (c) 2006-2007, Index Data.
This file is part of Pazpar2.
void start_zproxy(void);
extern struct parameters global_parameters;
-extern IOCHAN channel_list;
-
+void pazpar2_add_channel(IOCHAN c);
+void pazpar2_event_loop(void);
#endif
/*