X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fhttp.c;h=59d0050e8a4c41bdc5379f8e2593a8c9e945621e;hb=1b423121ae5ccbf05ff800ea229a9941b0a52dee;hp=0f5da4ea06be9d737a66c5302e84045158b01c28;hpb=07bcab2a08186836333fe62a5ebab348e7c17b0d;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index 0f5da4e..59d0050 100644 --- a/src/http.c +++ b/src/http.c @@ -63,7 +63,7 @@ typedef int socklen_t; #include #include -#include "pazpar2.h" +#include "session.h" #include "http.h" #define MAX_HTTP_HEADER 4096 @@ -797,9 +797,10 @@ static int http_proxy(struct http_request *rq) p->first_response = 1; c->proxy = p; // We will add EVENT_OUTPUT below - p->iochan = iochan_create(sock, proxy_io, EVENT_INPUT); + p->iochan = iochan_create(sock, proxy_io, EVENT_INPUT, "http_proxy"); iochan_setdata(p->iochan, p); - pazpar2_add_channel(p->iochan); + + iochan_add(ser->iochan_man, p->iochan); } // Do _not_ modify Host: header, just checking it's existence @@ -1129,6 +1130,7 @@ static struct http_channel *http_channel_create(http_server_t hs, http_server_incref(hs); r->http_server = hs; r->http_sessions = hs->http_sessions; + assert(r->http_sessions); r->server = server; r->proxy = 0; r->iochan = 0; @@ -1168,14 +1170,13 @@ static void http_accept(IOCHAN i, int event) enable_nonblock(s); yaz_log(YLOG_DEBUG, "New command connection"); - c = iochan_create(s, http_io, EVENT_INPUT | EVENT_EXCEPT); + c = iochan_create(s, http_io, EVENT_INPUT | EVENT_EXCEPT, "http_session_socket"); ch = http_channel_create(server->http_server, inet_ntoa(addr.sin_addr), server); ch->iochan = c; iochan_setdata(c, ch); - - pazpar2_add_channel(c); + iochan_add(server->iochan_man, c); } /* Create a http-channel listener, syntax [host:]port */ @@ -1244,9 +1245,10 @@ int http_init(const char *addr, struct conf_server *server) server->http_server->listener_socket = l; - c = iochan_create(l, http_accept, EVENT_INPUT | EVENT_EXCEPT); + c = iochan_create(l, http_accept, EVENT_INPUT | EVENT_EXCEPT, "http_server"); iochan_setdata(c, server); - pazpar2_add_channel(c); + + iochan_add(server->iochan_man, c); return 0; }