srv: look SRV records up through Android's resolver #10

Closed
asxpi wants to merge 0 commits from asxpi/libtacky:fix/android-srv into develop
First-time contributor

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

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](https://claude.com/claude-code)
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.

Assisted-by: Claude:opus-5-5
Owner

Merged by hand into develop (merge commit in the 8411e18f line) 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.

Merged by hand into develop (merge commit in the 8411e18f line) 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.
ann closed this pull request 2026-10-17 14:58:29 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
another-im/libtacky!10
No description provided.