mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
fix(ssdp): ssdp:all provide better feedback (#720)
* fix: ssdp:all provide a better feedback * Add more debug statements to webserver
This commit is contained in:
parent
9a587d3a27
commit
56023ed154
@ -9,6 +9,8 @@
|
||||
#include <QNetworkInterface>
|
||||
#include <QNetworkConfigurationManager>
|
||||
|
||||
static const QString SSDP_HYPERION_ST("urn:hyperion-project.org:device:basic:1");
|
||||
|
||||
SSDPHandler::SSDPHandler(WebServer* webserver, const quint16& flatBufPort, const quint16& jsonServerPort, const QString& name, QObject * parent)
|
||||
: SSDPServer(parent)
|
||||
, _webserver(webserver)
|
||||
@ -33,7 +35,7 @@ void SSDPHandler::initServer()
|
||||
// announce targets
|
||||
_deviceList.push_back("upnp:rootdevice");
|
||||
_deviceList.push_back("uuid:"+_uuid);
|
||||
_deviceList.push_back("urn:hyperion-project.org:device:basic:1");
|
||||
_deviceList.push_back(SSDP_HYPERION_ST);
|
||||
|
||||
// prep server
|
||||
SSDPServer::initServer();
|
||||
@ -145,7 +147,9 @@ void SSDPHandler::handleMSearchRequest(const QString& target, const QString& mx,
|
||||
// TODO Response delay according to MX field (sec) random between 0 and MX
|
||||
|
||||
// when searched for all devices / root devices / basic device
|
||||
if(target == "ssdp:all" || target == "upnp:rootdevice" || target == "urn:schemas-upnp-org:device:basic:1" || target == "urn:hyperion-project.org:device:basic:1")
|
||||
if(target == "ssdp:all")
|
||||
sendMSearchResponse(SSDP_HYPERION_ST, address, port);
|
||||
else if(target == "upnp:rootdevice" || target == "urn:schemas-upnp-org:device:basic:1" || target == SSDP_HYPERION_ST)
|
||||
sendMSearchResponse(target, address, port);
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ WebServer::~WebServer()
|
||||
|
||||
void WebServer::initServer()
|
||||
{
|
||||
Debug(_log, "Initialize Webserver");
|
||||
_server = new QtHttpServer (this);
|
||||
_server->setServerName (QStringLiteral ("Hyperion Webserver"));
|
||||
|
||||
@ -85,6 +86,7 @@ void WebServer::handleSettingsUpdate(const settings::type& type, const QJsonDocu
|
||||
{
|
||||
if(type == settings::WEBSERVER)
|
||||
{
|
||||
Debug(_log, "Apply Webserver settings");
|
||||
const QJsonObject& obj = config.object();
|
||||
|
||||
_baseUrl = obj["document_root"].toString(WEBSERVER_DEFAULT_PATH);
|
||||
|
Loading…
Reference in New Issue
Block a user