Changeset View
Changeset View
Standalone View
Standalone View
src/mdnsd-publicservice.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | 162 | for (QMap<QString, QByteArray>::ConstIterator it = d->m_textData.cbegin(); it != itEnd; ++it) { | |||
---|---|---|---|---|---|
163 | if (TXTRecordSetValue(&txt, it.key().toUtf8().constData(), it.value().length(), it.value().constData()) != kDNSServiceErr_NoError) { | 163 | if (TXTRecordSetValue(&txt, it.key().toUtf8().constData(), it.value().length(), it.value().constData()) != kDNSServiceErr_NoError) { | ||
164 | TXTRecordDeallocate(&txt); | 164 | TXTRecordDeallocate(&txt); | ||
165 | emit published(false); | 165 | emit published(false); | ||
166 | return; | 166 | return; | ||
167 | } | 167 | } | ||
168 | } | 168 | } | ||
169 | DNSServiceRef ref; | 169 | DNSServiceRef ref; | ||
170 | QString fullType = d->m_type; | 170 | QString fullType = d->m_type; | ||
171 | Q_FOREACH (const QString &subtype, d->m_subtypes) { | 171 | for (const QString &subtype : qAsConst(d->m_subtypes)) { | ||
172 | fullType += ',' + subtype; | 172 | fullType += ',' + subtype; | ||
173 | } | 173 | } | ||
174 | if (DNSServiceRegister(&ref, 0, 0, d->m_serviceName.toUtf8().constData(), fullType.toLatin1().constData(), domainToDNS(d->m_domain).constData(), NULL, | 174 | if (DNSServiceRegister(&ref, 0, 0, d->m_serviceName.toUtf8().constData(), fullType.toLatin1().constData(), domainToDNS(d->m_domain).constData(), NULL, | ||
175 | htons(d->m_port), TXTRecordGetLength(&txt), TXTRecordGetBytesPtr(&txt), publish_callback, | 175 | htons(d->m_port), TXTRecordGetLength(&txt), TXTRecordGetBytesPtr(&txt), publish_callback, | ||
176 | reinterpret_cast<void *>(d)) == kDNSServiceErr_NoError) { | 176 | reinterpret_cast<void *>(d)) == kDNSServiceErr_NoError) { | ||
177 | d->setRef(ref); | 177 | d->setRef(ref); | ||
178 | } | 178 | } | ||
179 | TXTRecordDeallocate(&txt); | 179 | TXTRecordDeallocate(&txt); | ||
Show All 38 Lines |