diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2009-02-18 00:19:32 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2009-02-18 00:19:32 +0100 |
commit | e3343f602dfe288afa1f027563d307d049d95c1e (patch) | |
tree | 27d213be41939ebcb57efafba3d79221556896bc /tntconfig.cpp | |
parent | f9738cfe51da2e3dd0533398e51079f8487b7ff5 (diff) | |
download | vdr-plugin-live-e3343f602dfe288afa1f027563d307d049d95c1e.tar.gz vdr-plugin-live-e3343f602dfe288afa1f027563d307d049d95c1e.tar.bz2 |
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.
Diffstat (limited to 'tntconfig.cpp')
-rw-r--r-- | tntconfig.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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 |