fixed bug
This commit is contained in:
parent
80d493ef78
commit
345bd0fc47
4
main.js
4
main.js
@ -174,7 +174,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) {
|
|||||||
class: 'IN',
|
class: 'IN',
|
||||||
ttl: 120,
|
ttl: 120,
|
||||||
// Convert plain string to buffer; required by mdns-server
|
// Convert plain string to buffer; required by mdns-server
|
||||||
data: Buffer.from(db.remote.services[name].TXT, 'utf8')
|
data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8'))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 5. Many mDNS tools (like Avahi or Bonjour) send type: 'ANY' queries to discover all records for a name.
|
// 5. Many mDNS tools (like Avahi or Bonjour) send type: 'ANY' queries to discover all records for a name.
|
||||||
@ -191,7 +191,7 @@ function replyLocallyWithRemoteDevicesData(name,type,query) {
|
|||||||
if (db.remote.services[name]) {
|
if (db.remote.services[name]) {
|
||||||
const r = db.remote.services[name];
|
const r = db.remote.services[name];
|
||||||
if (r.SRV) answers.push({ name, type: 'SRV', class: 'IN', ttl: 120, data: r.SRV });
|
if (r.SRV) answers.push({ name, type: 'SRV', class: 'IN', ttl: 120, data: r.SRV });
|
||||||
if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data)) });
|
if (r.TXT) answers.push({ name, type: 'TXT', class: 'IN', ttl: 120, data: r.TXT.map(entry=>Buffer.from(entry.data,'utf8')) });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user