X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp.c;h=f4aa55d0925af6ce81af5244b8fb3ba51b61b62a;hb=f030fa5726d942a82ffebb2ee22e35338ccfed78;hp=e408fe8e11222fbe7f7173a5568f5c96cf86ea83;hpb=1f6844b18354bd131532c1403179923848145c09;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index e408fe8..f4aa55d 100644 --- a/src/http.c +++ b/src/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.26 2007-04-15 00:35:57 quinn 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. @@ -56,9 +56,6 @@ static void proxy_io(IOCHAN i, int event); static struct http_channel *http_create(const char *addr); static void http_destroy(IOCHAN i); -extern IOCHAN channel_list; -extern struct parameters global_parameters; - // If this is set, we proxy normal HTTP requests static struct sockaddr_in *proxy_addr = 0; static char proxy_url[256] = ""; @@ -611,8 +608,7 @@ static int http_proxy(struct http_request *rq) // 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 @@ -980,8 +976,7 @@ static void http_accept(IOCHAN i, int event) 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 */ @@ -1045,8 +1040,7 @@ void http_init(const char *addr) 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)