summaryrefslogtreecommitdiff
path: root/tntconfig.cpp
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-02-18 00:19:32 +0100
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2009-02-18 00:19:32 +0100
commite3343f602dfe288afa1f027563d307d049d95c1e (patch)
tree27d213be41939ebcb57efafba3d79221556896bc /tntconfig.cpp
parentf9738cfe51da2e3dd0533398e51079f8487b7ff5 (diff)
downloadvdr-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.cpp13
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