srv: look SRV records up through Android's resolver #10
Loading…
Reference in a new issue
No description provided.
Delete branch "asxpi/libtacky:fix/android-srv"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Android has no /etc/resolv.conf, so the stub resolver cannot be
configured there and every SRV lookup fell back to the domain itself
on 5222. A domain whose server is elsewhere could not be signed in to
with the host left empty, which is what the sign-in form asks for:
narayana.im, served from xmpp.narayana.im, refused the connection.
Only typing the server's host in by hand worked.
On Android, ask the system's resolver through the NDK's DNS API
(android_res_nquery, <android/multinetwork.h>, API 29; the app's floor
is 30), which is netd's: the network's servers, Private DNS and the
cache, as every other app's lookups are. libandroid is looked up at run
time, so no embedder has a library to add; without the API the old
fallback stays. A query may take 2 s rather than 500 ms, since this
resolver is known to be there.
Tested on a Pixel 9: narayana.im resolves to xmpp.narayana.im:5222 and
:5223 and the account connects with the host left empty; without this
change it is refused.
Written and tested on v1.0.0-rc7 (
b40975d6); rebased onto develop (7b31417d), where it applies cleanly.🤖 Generated with Claude Code
Merged by hand into develop (merge commit in the
8411e18fline) and released in v1.0.0-rc10; thank you. PR #10 went in with a review follow-up (6996b1f9: the wire-answer parse under test, a deadline on the poll, the resolve() doc). Closing, since a hand merge is not marked merged here.Pull request closed