mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
zeroconf updates (#421)
* zeroconf: add ip make names more uniq * tune dns name for webconfig
This commit is contained in:
@@ -90,7 +90,7 @@ void BonjourServiceBrowser::bonjourBrowseReply(DNSServiceRef , DNSServiceFlags f
|
||||
else
|
||||
{
|
||||
BonjourRecord bonjourRecord(serviceName, regType, replyDomain);
|
||||
if (flags & kDNSServiceFlagsAdd)
|
||||
if ((flags & kDNSServiceFlagsAdd) != 0)
|
||||
{
|
||||
if (!serviceBrowser->bonjourRecords.contains(bonjourRecord))
|
||||
{
|
||||
|
@@ -505,6 +505,7 @@ void Hyperion::bonjourRecordResolved(const QHostInfo &hostInfo, int port)
|
||||
}
|
||||
_hyperionSessions[_bonjourCurrentServiceToResolve].hostName = host;
|
||||
_hyperionSessions[_bonjourCurrentServiceToResolve].port = port;
|
||||
_hyperionSessions[_bonjourCurrentServiceToResolve].address = hostInfo.addresses().isEmpty() ? "" : hostInfo.addresses().first().toString();
|
||||
Debug(_log, "found hyperion session: %s:%d",QSTRING_CSTR(hostInfo.hostName()), port);
|
||||
}
|
||||
}
|
||||
|
@@ -841,6 +841,7 @@ void JsonClientConnection::handleServerInfoCommand(const QJsonObject&, const QSt
|
||||
item["type"] = session.registeredType;
|
||||
item["domain"] = session.replyDomain;
|
||||
item["host"] = session.hostName;
|
||||
item["address"]= session.address;
|
||||
item["port"] = session.port;
|
||||
sessions.append(item);
|
||||
}
|
||||
|
@@ -44,8 +44,8 @@ StaticFileServing::~StaticFileServing ()
|
||||
void StaticFileServing::onServerStarted (quint16 port)
|
||||
{
|
||||
Info(_log, "started on port %d name '%s'", port ,_server->getServerName().toStdString().c_str());
|
||||
|
||||
const QString mDNSDescr = _server->getServerName() + "@" + QHostInfo::localHostName();
|
||||
const QJsonObject & generalConfig = _hyperion->getQJsonConfig()["general"].toObject();
|
||||
const QString mDNSDescr = generalConfig["name"].toString("") + "@" + QHostInfo::localHostName() + ":" + QString::number(port);
|
||||
|
||||
BonjourServiceRegister *bonjourRegister_http = new BonjourServiceRegister();
|
||||
bonjourRegister_http->registerService(
|
||||
|
@@ -19,7 +19,7 @@ WebConfig::WebConfig(QObject * parent)
|
||||
{
|
||||
const QJsonObject webconfigConfig = config["webConfig"].toObject();
|
||||
webconfigEnable = webconfigConfig["enable"].toBool(true);
|
||||
_port = webconfigConfig["port"].toInt(_port);
|
||||
_port = webconfigConfig["port"].toInt(_port);
|
||||
_baseUrl = webconfigConfig["document_root"].toString(_baseUrl);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user