From e3343f602dfe288afa1f027563d307d049d95c1e Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Wed, 18 Feb 2009 00:19:32 +0100 Subject: Fixed the need to add an --ip parameter on the live command line if the host had no IPv6 support in the kernel (or module). Don't abort operation if one of the given ips fails at bind call. Abort only if every bind call fails. --- tntconfig.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tntconfig.cpp') diff --git a/tntconfig.cpp b/tntconfig.cpp index 23943a5..d35dad4 100644 --- a/tntconfig.cpp +++ b/tntconfig.cpp @@ -252,8 +252,19 @@ namespace vdrlive { Setup::IpList const& ips = LiveSetup().GetServerIps(); int port = LiveSetup().GetServerPort(); + size_t listenFailures = 0; for ( Setup::IpList::const_iterator ip = ips.begin(); ip != ips.end(); ++ip ) { - app.listen(*ip, port); + try { + app.listen(*ip, port); + } + catch (exception const & ex) { + esyslog("ERROR: live ip = %s is invalid: exception = %s", ip->c_str(), ex.what()); + if (++listenFailures == ips.size()) { + // if no listener was initialized we throw at + // least the last exception to the next layer. + throw; + } + } } #if TNTSSLSUPPORT -- cgit v1.2.3