forked from jbagg/QtZeroConf
AvahiClient - Fix parsing of TXT records if value contains '='
TXT record values can also contain equals signs. The current implementation would consider any record where the value contains an equals sign as an empty record.
This commit is contained in:
@ -153,11 +153,11 @@ public:
|
||||
while (txt) // get txt records
|
||||
{
|
||||
QByteArray avahiText((const char *)txt->text, txt->size);
|
||||
QList<QByteArray> pair = avahiText.split('=');
|
||||
if (pair.size() == 2)
|
||||
zcs->m_txt[pair.at(0)] = pair.at(1);
|
||||
const ssize_t pos = avahiText.indexOf('=');
|
||||
if (pos < 0)
|
||||
zcs->m_txt[avahiText] = "";
|
||||
else
|
||||
zcs->m_txt[pair.at(0)] = "";
|
||||
zcs->m_txt[avahiText.left(pos)] = avahiText.mid(pos + 1, -1);
|
||||
txt = txt->next;
|
||||
}
|
||||
ref->pub->services.insert(key, zcs);
|
||||
|
Reference in New Issue
Block a user