From 14063a80e9891d1dbc274392a049b970196787ec Mon Sep 17 00:00:00 2001 From: srcejon Date: Wed, 6 Nov 2024 12:12:46 +0000 Subject: [PATCH] Support compilation without SSL support. --- .../remotetcpinput/remotetcpinputtcphandler.cpp | 8 ++++++++ .../remotetcpinput/remotetcpinputtcphandler.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp index d383326b2..a98afd39d 100644 --- a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp +++ b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.cpp @@ -150,6 +150,7 @@ void RemoteTCPInputTCPHandler::connectToHost(const QString& address, quint16 por m_readMetaData = false; if (protocol == "SDRangel wss") { +#ifndef QT_NO_OPENSSL m_webSocket = new QWebSocket(QString(), QWebSocketProtocol::VersionLatest, this); connect(m_webSocket, &QWebSocket::binaryFrameReceived, this, &RemoteTCPInputTCPHandler::dataReadyRead); connect(m_webSocket, &QWebSocket::connected, this, &RemoteTCPInputTCPHandler::connected); @@ -160,6 +161,9 @@ void RemoteTCPInputTCPHandler::connectToHost(const QString& address, quint16 por connect(m_webSocket, &QWebSocket::sslErrors, this, &RemoteTCPInputTCPHandler::sslErrors); m_webSocket->open(QUrl(QString("wss://%1:%2").arg(address).arg(port))); m_dataSocket = new WebSocket(m_webSocket); +#else + qWarning() << "RemoteTCPInput unable to use wss protocol as SSL is not supported"; +#endif } else { @@ -202,6 +206,7 @@ void RemoteTCPInputTCPHandler::cleanup() FLAC__stream_decoder_delete(m_decoder); m_decoder = nullptr; } +#ifndef QT_NO_OPENSSL if (m_webSocket) { qDebug() << "RemoteTCPInputTCPHandler::cleanup: Closing and deleting web socket"; @@ -212,6 +217,7 @@ void RemoteTCPInputTCPHandler::cleanup() disconnect(m_webSocket, &QWebSocket::errorOccurred, this, &RemoteTCPInputTCPHandler::errorOccurred); #endif } +#endif if (m_tcpSocket) { qDebug() << "RemoteTCPInputTCPHandler::cleanup: Closing and deleting TCP socket"; @@ -1071,11 +1077,13 @@ void RemoteTCPInputTCPHandler::errorOccurred(QAbstractSocket::SocketError socket } } +#ifndef QT_NO_OPENSSL void RemoteTCPInputTCPHandler::sslErrors(const QList &errors) { qDebug() << "RemoteTCPInputTCPHandler::sslErrors: " << errors; m_webSocket->ignoreSslErrors(); // FIXME: Add a setting whether to do this? } +#endif void RemoteTCPInputTCPHandler::dataReadyRead() { diff --git a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.h b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.h index 082c2a190..da7fca8af 100644 --- a/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.h +++ b/plugins/samplesource/remotetcpinput/remotetcpinputtcphandler.h @@ -187,7 +187,9 @@ public slots: void connected(); void disconnected(); void errorOccurred(QAbstractSocket::SocketError socketError); +#ifndef QT_NO_OPENSSL void sslErrors(const QList &errors); +#endif private: