Comments (6)
I suspect this will have to be fixed in the upstream dns-parser
repository here.
Either:
- The mDNS servers you are connecting to are using non-ascii data for names
- The DNS standard explicitly allows this
-
Although the Domain Name System supports non-ASCII characters, applications such as e-mail and web browsers restrict the characters which can be used as domain names for purposes such as a hostname
- The
dns-parser
is incorrectly parsing the name, reading out of bounds where adjacent binary data is located
I suspect the first one is more likely.
As far as I can see in dns-parser/src/name.rs
, it will always reject non-ASCII names, so perhaps the parser needs to be extended to support UTF-8 values.
from mdns.
What error message/source location do you get from the panic?
I am surprised that UTF-8 has issues.
from mdns.
I'm also running into this, but it's only panicing since I have an unwrap
in my code though (as in the example)
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Dns(LabelIsNotAscii)
from mdns.
Sort of related to this, but on the other end of the spectrum; while probing for elgato lights (_elg._tcp.local
), I get lots of this eprintln output happening, which is pretty undesirable:
https://github.com/dylanmckay/mdns/blob/master/src/mdns.rs#L101
LabelIsNotAscii, [<hundreds of bytes in decimal here>]
I appreciate that discovery doesn't completely give up for these because I do occasionally get proper responses from this, but I wonder if we can do something to control this unconditional output?
Two ideas come to mind:
- Adopt the
log
crate andlog::debug
these messages - Make that stream return an enum with either a valid response or the dns_parser error
what do you think?
from mdns.
I forked dns-parser to make it handle utf8 in labels and that cured my immediate problem; the commits are referenced above
from mdns.
Adopt the log crate and log::debug these messages
Your wish is my command: 2.0.0...2.0.2
If you have any patches to send my way related to the other things, they are welcome :)
from mdns.
Related Issues (15)
- Support exotic DNS class names HOT 1
- Unhardcode ipaddr and port HOT 7
- Support IPv6 HOT 2
- Endless loop floods the network HOT 8
- Clarify README.md
- Support for TXT Records in service HOT 1
- Publish new services HOT 2
- Doesn't find some of my devices HOT 4
- How to use this as a library? HOT 1
- Example without tokio::main?
- Seemingly broken on Windows HOT 1
- tokio/async-std features
- Example never returns from stream.nex().await HOT 4
- The stream in the example returns the same IP repeatedly and never terminates
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdns.