richardschneider / net-mdns

Simple multicast DNS
MIT License
232 stars 81 forks source link

Advertising issues #33

Closed eshvatskyi closed 6 years ago

eshvatskyi commented 6 years ago

very strange. can not get stable recorn when browsing my local mdns. sometimes record appears after 10 minutes, and only a top-level. and browser, in general, had issues with getting other records (takes a lot of time to get all). after I stopped a project everything works fine.

11/3/2018 2:09:12 AM [DEBUG] Makaretu.Dns.ServiceDiscovery - got query for _services._dns-sd._udp.local PTR 11/3/2018 2:09:12 AM [DEBUG] Makaretu.Dns.ServiceDiscovery - sent answer _services._dns-sd._udp.local IN PTR _hap._tcp.local

richardschneider commented 6 years ago

@eshvatskyi I'm happy to help, but will need more information. The best way is to create a repo on Github, then I can try to get working.

can not get stable recorn

What does recorn mean?

eshvatskyi commented 6 years ago

Sorry :) was too late. :) It means "record", I try to prepare POC to reproduce this issue.

eshvatskyi commented 6 years ago

The issues in NameServer

        foreach (var question in request.Questions)
        {
            var questionResponse = await ResolveAsync(question, null, cancel);

            response.Answers.AddRange(questionResponse.Answers);
            response.AdditionalRecords.AddRange(questionResponse.AdditionalRecords);
            response.AuthorityRecords.AddRange(questionResponse.AuthorityRecords);

            if (response.Answers.Count > 0 && !AnswerAllQuestions)
                break;
        }

        .....

        if (response.Answers.Count == 0)
        {
            response.Status = MessageStatus.NameError;
        }

when you received 3 question and 1 is not a vald name all 3 answers is not sent back, even if other is valid

eshvatskyi commented 6 years ago

Also, I found some duplicated code and have a lot "code review comments" if you have interest in

richardschneider commented 6 years ago

@eshvatskyi I'll try to release dns and mdns in the next few hours.

I am very interested in any "code review comments".