X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp.c;h=189cbe357cb3c0ccccedf02f15e5decb8be0ebdb;hb=c2705b2bc91f199440a2adad7c3274bcdcce6509;hp=020e285bbad31a72270930fc45a8507f2ec3b854;hpb=beea258a9423652de5dba16306551df31fc5519e;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index 020e285..189cbe3 100644 --- a/src/http.c +++ b/src/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.27 2007-04-16 09:03:25 adam Exp $ +/* $Id: http.c,v 1.30 2007-04-23 08:56:52 marc Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -608,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 @@ -977,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 */ @@ -1005,8 +1003,7 @@ void http_init(const char *addr) strncpy(hostname, addr, len); hostname[len] = '\0'; - if (!(he = gethostbyname(hostname))) - { + if (!(he = gethostbyname(hostname))){ yaz_log(YLOG_FATAL, "Unable to resolve '%s'", hostname); exit(1); } @@ -1042,8 +1039,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)