Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of service names with dots #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgutman
Copy link
Contributor

@cgutman cgutman commented Jul 1, 2018

QMdnsEngine currently assumes service names will not contain dots. This causes it to mishandle mDNS responses for NVIDIA GameStream which contain several dots in the service name.

The following is an example of such a response:
_nvstream._tcp.local: type PTR, class IN, 3.14.0.161-WIN10-GS.765ebd34-e2e9-4502-8fdd-5e8ed485b667._nvstream._tcp.local

The current parsing logic results in 3 being considered the service name, rather than 3.14.0.161-WIN10-GS.765ebd34-e2e9-4502-8fdd-5e8ed485b667. Other mDNS implementations I've tried (jmDNS and NSNetServiceBrowser) return the expected service name.

I updated the Browser unit test to exercise this fix.

@@ -63,7 +63,7 @@ BrowserPrivate::BrowserPrivate(Browser *browser, AbstractServer *server, const Q
bool BrowserPrivate::updateService(const QByteArray &fqName)
{
// Split the FQDN into service name and type
int index = fqName.indexOf('.');
int index = fqName.indexOf('_') - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps this should be "._" (assume empty service names shouldn't be supported)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants