Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jul 23, 2019
1 parent 95b2cad commit c180b7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Discovery/Mdns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ void OnServiceInstanceDiscovered(object sender, ServiceInstanceDiscoveryEventArg
var msg = e.Message;

// Is it our service?
var qsn = ServiceName + ".local";
if (!e.ServiceInstanceName.EndsWith(qsn))
var qsn = new DomainName(ServiceName + ".local");
if (!e.ServiceInstanceName.BelongsTo(qsn))
return;

var addresses = GetAddresses(msg)
Expand Down
12 changes: 6 additions & 6 deletions src/Discovery/MdnsJs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override ServiceProfile BuildProfile()
);
profile.Resources.RemoveAll(r => r.Type == DnsType.TXT);
var txt = new TXTRecord { Name = profile.FullyQualifiedName };
txt.Strings.Add(profile.InstanceName);
txt.Strings.Add(profile.InstanceName.ToString());
profile.Resources.Add(txt);

return profile;
Expand All @@ -72,24 +72,24 @@ public override IEnumerable<MultiAddress> GetAddresses(Message message)
var qsn = ServiceName + ".local";
var peerNames = message.Answers
.OfType<PTRRecord>()
.Where(a => DnsObject.NamesEquals(a.Name, qsn))
.Where(a => a.Name == qsn)
.Select(a => a.DomainName);
foreach (var name in peerNames)
{
var id = name.Split('.')[0];
var id = name.Labels[0];
var srv = message.Answers
.OfType<SRVRecord>()
.First(r => DnsObject.NamesEquals(r.Name, name));
.First(r => r.Name == name);
var aRecords = message.Answers
.OfType<ARecord>()
.Where(a => DnsObject.NamesEquals(a.Name, name) || DnsObject.NamesEquals(a.Name, srv.Target));
.Where(a => a.Name == name || a.Name == srv.Target);
foreach (var a in aRecords)
{
yield return new MultiAddress($"/ip4/{a.Address}/tcp/{srv.Port}/ipfs/{id}");
}
var aaaaRecords = message.Answers
.OfType<AAAARecord>()
.Where(a => DnsObject.NamesEquals(a.Name, name) || DnsObject.NamesEquals(a.Name, srv.Target));
.Where(a => a.Name == name || a.Name == srv.Target);
foreach (var a in aaaaRecords)
{
yield return new MultiAddress($"/ip6/{a.Address}/tcp/{srv.Port}/ipfs/{id}");
Expand Down
2 changes: 1 addition & 1 deletion src/PeerTalk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<ItemGroup>
<PackageReference Include="Ipfs.Core" Version="0.52.1" />
<PackageReference Include="Makaretu.Dns.Multicast" Version="0.21.0" />
<PackageReference Include="Makaretu.Dns.Multicast" Version="0.24.0" />
<PackageReference Include="Makaretu.KBucket" Version="0.5.0" />
<PackageReference Include="Nito.AsyncEx" Version="5.0.0" />
<PackageReference Include="protobuf-net" Version="2.4.0" />
Expand Down

0 comments on commit c180b7b

Please sign in to comment.