From 6791ce30c239a1eeab591bb77a41afda9866791c Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Wed, 11 Feb 2015 00:41:45 +0100 Subject: [PATCH] Drop support for old tntnet versions: SSL/TLS support is no more optional. LIVE can be compiled only with versions of tntnet which support SSL/TLS connections. --- setup.cpp | 14 +------------- setup.h | 6 ------ tntconfig.cpp | 2 -- tntfeatures.h | 3 --- 4 files changed, 1 insertion(+), 24 deletions(-) diff --git a/setup.cpp b/setup.cpp index f6bf168f..00d496ff 100644 --- a/setup.cpp +++ b/setup.cpp @@ -27,11 +27,9 @@ using namespace std; Setup::Setup(): m_serverPort( 8008 ), -#if TNT_SSL_SUPPORT m_serverSslPort( 8443 ), m_serverSslCert(), m_serverSslKey(), -#endif m_lastChannel( 0 ), m_screenshotInterval( 1000 ), m_useAuth( 1 ), @@ -62,11 +60,9 @@ bool Setup::ParseCommandLine( int argc, char* argv[] ) { "ip", required_argument, NULL, 'i' }, { "log", required_argument, NULL, 'l' }, { "epgimages", required_argument, NULL, 'e' }, -#if TNT_SSL_SUPPORT { "sslport", required_argument, NULL, 's' }, { "cert", required_argument, NULL, 'c' }, { "key", required_argument, NULL, 'k' }, -#endif { 0 } }; @@ -77,19 +73,15 @@ bool Setup::ParseCommandLine( int argc, char* argv[] ) case 'i': m_serverIps.push_back( optarg ); break; case 'l': m_tntnetloglevel = optarg; break; case 'e': m_epgimagedir = optarg; break; -#if TNT_SSL_SUPPORT case 's': m_serverSslPort = atoi( optarg ); break; case 'c': m_serverSslCert = optarg; break; case 'k': m_serverSslKey = optarg; break; -#endif default: return false; } } return CheckServerPort() && -#if TNT_SSL_SUPPORT CheckServerSslPort() && -#endif CheckServerIps(); } @@ -97,17 +89,15 @@ char const* Setup::CommandLineHelp() const { if ( m_helpString.empty() ) { ostringstream builder; - builder << " -p PORT, --port=PORT use PORT to listen for incoming connections\n" + builder << " -p PORT, --port=PORT use PORT to listen for incoming connections\n" " (default: " << m_serverPort << ")\n" << " -i IP, --ip=IP bind server only to specified IP, may appear\n" " multiple times\n" " (default: 0.0.0.0)\n" -#if TNT_SSL_SUPPORT << " -s PORT, --sslport=PORT use PORT to listen for incoming ssl connections\n" " (default: " << m_serverSslPort << ")\n" << " -c CERT, --cert=CERT full path to a custom ssl certificate file\n" << " -k KEY, --key=KEY full path to a custom ssl certificate key file\n" -#endif << " -l level, --log=level log level for tntnet (values: WARN, ERROR, INFO, DEBUG, TRACE)\n" << " -e , --epgimages= directory for epgimages\n"; m_helpString = builder.str(); @@ -153,7 +143,6 @@ bool Setup::CheckServerPort() return true; } -#if TNT_SSL_SUPPORT bool Setup::CheckServerSslPort() { if ( m_serverSslPort <= 0 || m_serverSslPort > numeric_limits< uint16_t >::max() ) { @@ -163,7 +152,6 @@ bool Setup::CheckServerSslPort() } return true; } -#endif namespace { struct IpValidator diff --git a/setup.h b/setup.h index 58b4a11c..3b4e3889 100644 --- a/setup.h +++ b/setup.h @@ -29,11 +29,9 @@ class Setup // commandline int GetServerPort() const { return m_serverPort; } -#if TNT_SSL_SUPPORT int GetServerSslPort() const { return m_serverSslPort; } std::string GetServerSslCert() const { return m_serverSslCert; } std::string GetServerSslKey() const { return m_serverSslKey; } -#endif IpList const& GetServerIps() const { return m_serverIps; } // vdr-setup int GetLastChannel() const { return m_lastChannel == 0 ? std::numeric_limits< int >::max() : m_lastChannel; } @@ -108,12 +106,10 @@ class Setup mutable std::string m_helpString; // commandline options int m_serverPort; -#if TNT_SSL_SUPPORT int m_serverSslPort; std::string m_serverSslCert; std::string m_serverSslKey; static std::string m_configDirectory; -#endif IpList m_serverIps; std::string m_epgimagedir; @@ -145,9 +141,7 @@ class Setup bool CheckServerPort(); bool CheckServerIps(); -#if TNT_SSL_SUPPORT bool CheckServerSslPort(); -#endif }; Setup& LiveSetup(); diff --git a/tntconfig.cpp b/tntconfig.cpp index 03bea9e5..e4937ec7 100644 --- a/tntconfig.cpp +++ b/tntconfig.cpp @@ -232,7 +232,6 @@ namespace vdrlive { } } -#if TNT_SSL_SUPPORT int s_port = LiveSetup().GetServerSslPort(); string s_cert = LiveSetup().GetServerSslCert(); string s_key = LiveSetup().GetServerSslKey(); @@ -253,7 +252,6 @@ namespace vdrlive { else { esyslog( "[live] ERROR: Unable to load cert/key (%s/%s): %s", s_cert.c_str(), s_key.c_str(), strerror( errno ) ); } -#endif // TNT_SSL_SUPPORT } TntConfig const& TntConfig::Get() diff --git a/tntfeatures.h b/tntfeatures.h index d3404ec5..fafe78f6 100644 --- a/tntfeatures.h +++ b/tntfeatures.h @@ -7,9 +7,6 @@ // an other change in the structure of the version string was needed then only // this file needs to be adapted. -// SSL-Support works from tntnet version 1.6.1 onwards. -#define TNT_SSL_SUPPORT (TNTVERSION >= 16100) - // Query params without boolean parameter #define TNT_QUERYPARAMS_NO_BOOL (TNTVERSION >= 22000)