mirror of
https://github.com/debauchee/barrier.git
synced 2026-02-10 05:36:22 +08:00
Solved zeroconf service name conflict
This commit is contained in:
@@ -28,6 +28,10 @@ ZeroconfBrowser::ZeroconfBrowser(QObject* parent) :
|
|||||||
|
|
||||||
ZeroconfBrowser::~ZeroconfBrowser()
|
ZeroconfBrowser::~ZeroconfBrowser()
|
||||||
{
|
{
|
||||||
|
if (m_pSocket) {
|
||||||
|
delete m_pSocket;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_DnsServiceRef) {
|
if (m_DnsServiceRef) {
|
||||||
DNSServiceRefDeallocate(m_DnsServiceRef);
|
DNSServiceRefDeallocate(m_DnsServiceRef);
|
||||||
m_DnsServiceRef = 0;
|
m_DnsServiceRef = 0;
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ ZeroconfRegister::ZeroconfRegister(QObject* parent) :
|
|||||||
|
|
||||||
ZeroconfRegister::~ZeroconfRegister()
|
ZeroconfRegister::~ZeroconfRegister()
|
||||||
{
|
{
|
||||||
|
if (m_pSocket) {
|
||||||
|
delete m_pSocket;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_DnsServiceRef) {
|
if (m_DnsServiceRef) {
|
||||||
DNSServiceRefDeallocate(m_DnsServiceRef);
|
DNSServiceRefDeallocate(m_DnsServiceRef);
|
||||||
m_DnsServiceRef = 0;
|
m_DnsServiceRef = 0;
|
||||||
@@ -49,7 +53,8 @@ void ZeroconfRegister::registerService(const ZeroconfRecord& record,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DNSServiceErrorType err = DNSServiceRegister(&m_DnsServiceRef, 0, 0,
|
DNSServiceErrorType err = DNSServiceRegister(&m_DnsServiceRef,
|
||||||
|
kDNSServiceFlagsNoAutoRename, 0,
|
||||||
record.serviceName.toUtf8().constData(),
|
record.serviceName.toUtf8().constData(),
|
||||||
record.registeredType.toUtf8().constData(),
|
record.registeredType.toUtf8().constData(),
|
||||||
record.replyDomain.isEmpty() ? 0 : record.replyDomain.toUtf8().constData(),
|
record.replyDomain.isEmpty() ? 0 : record.replyDomain.toUtf8().constData(),
|
||||||
|
|||||||
Reference in New Issue
Block a user