-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Remove DNS handling from all C modules except net.dns
.
#3063
Comments
This raises an issue with |
Good call. |
Purely speaking as a firmware user now: this is... no, please don't do this. No network library/framework I know of has an API that accepts IP addresses only. It would be a grand step backwards.
Can't this be extracted into a shared piece of code that modules can include? I agree, it shouldn't be the module's responsibility to address cross-cutting concerns. |
You're right; this is an over-reaction on my part. Threading reference counts around |
This is actually an anti-feature request. Handling DNS in C is a pain and a source of object lifecycle bugs in our tree.
net.dns
gets it right, though the documentation asserts that there is only one callback in flight at once, which appears false. I'll add that to my next stack of cleanups.net
's socket handling at least tries to get it right, usingwait_dns
to continue to pin the userdata in the registry until the DNS callbacks have fired. This is entangled in its state machine, which is pretty messy.tls
gets it wrong, at the time of this writing, possibly referencing freed memory if the user completely drops atls
socket while a DNS operation is in progress.mqtt
andwebsocket
behave similarly, following pointers to possibly-dead memory.Anyway, I'd like to simplify the C world by removing any pretense of doing DNS and require that the Lua application use
net.dns
whenever DNS resolution is requisite. Note that, for example,coap
already does not support DNS, and evennet
's support is restricted to TCP and not UDP.The text was updated successfully, but these errors were encountered: