X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp.c;h=e46d2ae3442cec2ac05607290dcb08b283187bd2;hb=2fdbd5de9185e926401609c22b328f07af0248bd;hp=40ffbec4e41dab116284fb2a593f18f1e11366c7;hpb=315af5c601a268e2d0da60477c3470a6c12654c9;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index 40ffbec..e46d2ae 100644 --- a/src/http.c +++ b/src/http.c @@ -1,4 +1,4 @@ -/* $Id: http.c,v 1.29 2007-04-23 08:15:22 marc Exp $ +/* $Id: http.c,v 1.31 2007-05-15 08:51:49 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -1003,8 +1003,10 @@ 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); + } memcpy(&myaddr.sin_addr.s_addr, he->h_addr_list[0], he->h_length); port = atoi(pp + 1); @@ -1032,9 +1034,15 @@ void http_init(const char *addr) abort(); if (bind(l, (struct sockaddr *) &myaddr, sizeof myaddr) < 0) + { yaz_log(YLOG_FATAL|YLOG_ERRNO, "bind"); + exit(1); + } if (listen(l, SOMAXCONN) < 0) + { yaz_log(YLOG_FATAL|YLOG_ERRNO, "listen"); + exit(1); + } c = iochan_create(l, http_accept, EVENT_INPUT | EVENT_EXCEPT); pazpar2_add_channel(c);