On 27. 7. 25 05:25, Branko Čibej wrote:
On 26. 7. 25 22:11, br...@apache.org wrote:
Author: brane
Date: Sat Jul 26 20:11:05 2025
New Revision: 1927485
Log:
In the Unbound resolver, finally convert the results to apr_sockaddr_t.
[...]
@@ -60,8 +63,8 @@
* - Wake the poll/select in serf_context_run() when new resolve
* results are available.
*
- * TODO for Unbound:
- * - Convert unbound results to apr_sockaddr_t.
+ * - Unbound: Detect when the "hostname" is actually a stringified
IP address.
+ * The resolver doesn't handle that, so we have to short-circuit
that case.
*/
As I wrote above, the Unbound resolver doesn't know what to do when
given an IPv4 of IPv6 address as the "hostname". Obviously this needs
to be handled in Serf before/instead of calling Unbound. APR handles
this, and has its own apr_inet_pton() implementation, presumably for
platforms where the standard inet_pton() isn't available, but it's not
exported in the public API.
My thought is to add a compile-time check if inet_pton() is available,
and otherwise steal APR's implementation. I don't like the code
duplication, but short of exposing APR's implementation (and then
waiting for it to be released), I don't see a third option.
If no-one has a better idea, I'll implement this in the next week or
so. It's the last missing part of the Unbound integration except for
the build configuration bits.
I just went ahead and did this in r1927493/r1927494.
-- Brane