   Changelog for the c-ares project. Generated with git2changes.pl

Version 1.27.0 (22 Feb 2024)

GitHub (22 Feb 2024)
- [Brad House brought this change]

  Release 1.27.0 (#715)
  
  release prep for 1.27.0 release

- [Brad House brought this change]

  Merge pull request from GHSA-mg26-v6qh-x48q

- [Oliver Welsh brought this change]

  Add flag to not use a default local named server on channel initialization (#713)
  
  Hello, I work on an application for Microsoft which uses c-ares to
  perform DNS lookups. We have made some minor changes to the library over
  time, and would like to contribute these back to the project in case
  they are useful more widely. This PR adds a new channel init flag,
  described below.
  
  Please let me know if I can include any more information to make this PR
  better/easier for you to review. Thanks!
  
  **Summary**
  When initializing a channel with `ares_init_options()`, if there are no
  nameservers available (because `ARES_OPT_SERVERS` is not used and
  `/etc/resolv.conf` is either empty or not available) then a default
  local named server will be added to the channel.
  
  However in some applications a local named server will never be
  available. In this case, all subsequent queries on the channel will
  fail.
  
  If we know this ahead of time, then it may be preferred to fail channel
  initialization directly rather than wait for the queries to fail. This
  gives better visibility, since we know that the failure is due to
  missing servers rather than something going wrong with the queries.
  
  This PR adds a new flag `ARES_FLAG_NO_DFLT_SVR`, to indicate that a
  default local named server should not be added to a channel in this
  scenario. Instead, a new error `ARES_EINITNOSERVER` is returned and
  initialization fails.
  
  **Testing**
  I have added 2 new FV tests:
  - `ContainerNoDfltSvrEmptyInit` to test that initialization fails when
  no nameservers are available and the flag is set.
  - `ContainerNoDfltSvrFullInit` to test that initialization still
  succeeds when the flag is set but other nameservers are available.
  
  Existing FVs are all passing.
  
  **Documentation**
  I have had a go at manually updating the docs to describe the new
  flag/error, but couldn't see any contributing guidance about testing
  this. Please let me know if you'd like anything more here.
  
  ---------
  
  Fix By: Oliver Welsh (@oliverwelsh)

Brad House (18 Feb 2024)
- badge should be only main branch

- put logo in readme

- clang-format

GitHub (17 Feb 2024)
- [Brad House brought this change]

  Add ares_queue_active_queries() (#712)
  
  Add a function to request the number of active queries from an ares
  channel. This will return the number of inflight requests to dns
  servers. Some functions like `ares_getaddrinfo()` when using `AF_UNSPEC`
  may enqueue multiple queries which will be reflected in this count.
  
  In the future, if we implement support for queuing (e.g. for throttling
  purposes), and/or implement support for tracking user-requested queries
  (e.g. for cancelation), we can provide additional functions for
  inspecting those queues.
  
  Fix By: Brad House (@bradh352)

- [Vojtěch Vobr brought this change]

  fix leaking DNS suffix search list on Windows (#711)
  
  ares__strsplit provides a newly allocated buffer, so suffix list in
  line variable isn't referenced anymore. Related ares_free seems to
  have gone missing during refactoring made in #594
  
  Fix By: Vojtěch Vobr (@vojtechvobr)

- [Brad House brought this change]

  Add ares_queue_wait_empty() for use with EventThreads (#710)
  
  It may be useful to wait for the queue to be empty under certain conditions (mainly test cases), expose a function to efficiently do this and rework test cases to use it.
  
  Fix By: Brad House (@bradh352)

- [Cheng Zhao brought this change]

  Fix warning about ignoring result of write (#709)
  
  Fix the compiler warning from clang:
  
  ```
  ares_event_wake_pipe.c:120:3: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]
    120 |   write(p->filedes[1], "1", 1);
        |   ^~~~~ ~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ```
  
  Fix By: Cheng Zhao (@zcbenz)

Brad House (5 Feb 2024)
- CMake: don't override target output locations if not top-level
  
  CMake was unconditionally setting output locations globally, but
  it should not do that if it is not the top-level project (e.g.
  during chain building).  Detect this fact and only set the output
  location when top level.
  
  Fixes Issue: #708
  Fix By: Anthony Alayo (@anthonyalayo)

- make docs match PR #705

GitHub (31 Jan 2024)
- [Cristian Rodríguez brought this change]

  lower EDNSPACKETSZ to 1232 (#705)
  
  In 2020, it was agreed this is optimal maximum size and all
  major server software was updated to reflect this.
  
  see https://www.dnsflagday.net/2020/#faq
  
  Fix By: Cristian Rodríguez (@crrodriguez)

Brad House (30 Jan 2024)
- fix version

- fix typo

- bad symlink

- attempt to fix pkgconfig on windows for static builds

GitHub (28 Jan 2024)
- [Andriy Utkin brought this change]

  docs/ares_init_options.3: fix args in analogy (#701)
  
  Fix By: Andriy Utkin <hello@autkin.net>

- [Brad House brought this change]

  sonarcloud: fix minor codesmells (#702)
  
  Fix minor codesmells, mostly related to missing 'const' in the new event system.
  
  Fix By: Brad House (@bradh352)

Brad House (26 Jan 2024)
- remove outdated copyright text

- spelling

- sanity check GTest includes GMock component

GitHub (26 Jan 2024)
- [Brad House brought this change]

  build-time disabled threads breaks c-ares (#700)
  
  Regression introduced in 1.26.0, building c-ares with threading disabled results in ares_init{_options}() failing.
  
  Also adds a new CI test case to prevent this regression in the future.
  
  Fixes Bug: #699
  Fix By: Brad House (@bradh352)

Version 1.26.0 (25 Jan 2024)

Brad House (25 Jan 2024)
- clusterfuzz: enforce maximum DNS packet size due to long parser time

GitHub (24 Jan 2024)
- [Brad House brought this change]

  Release prep for c-ares 1.26.0 (#698)
  
  release prep

Brad House (24 Jan 2024)
- adig: Differentiate between internal and server error
  
  Should not output "Got answer" if there was no answer from the
  server, instead should just output the internal error.
  
  Fix By: Gisle Vanem (@gvanem)

GitHub (24 Jan 2024)
- [Brad House brought this change]

  Event Subsystem: No longer require integrators to have their own (#696)
  
  This PR implements an event thread to process all events on file descriptors registered by c-ares. Prior to this feature, integrators were required to understand the internals of c-ares and how to monitor file descriptors and timeouts and process events.
  
  Implements OS-specific efficient polling such as epoll(), kqueue(), or IOCP, and falls back to poll() or select() if otherwise unsupported. At this point, it depends on basic threading primitives such as pthreads or windows threads.
  
  If enabled via the ARES_OPT_EVENT_THREAD option passed to ares_init_options(), then socket callbacks cannot be used.
  
  Fixes Bug: #611
  Fix By: Brad House (@bradh352)

- [Erik Lax brought this change]

  Added flags to are_dns_parse to force RAW packet parsing (#693)
  
  This pull request adds six flags to instruct the parser under various circumstances to skip parsing of the returned RR records so the raw data can be retrieved.
  
  Fixes Bug: #686
  Fix By: Erik Lax (@eriklax)

- [Brad House brought this change]

  Autotools allow make to override CFLAGS/CPPFLAGS/CXXFLAGS (#695)
  
  The previous build system allowed overwriting of CFLAGS/CPPFLAGS/CXXFLAGS on the make command line. Switch to using AM_CFLAGS/AM_CPPFLAGS/AM_CXXFLAGS when we set our own flags for building which ensures they are kept even when a user tries to override.
  
  Fixes Bug: #694
  Fix By: Brad House (@bradh352)

Brad House (16 Jan 2024)
- fix doxygen typo

GitHub (16 Jan 2024)
- [Brad House brought this change]

  man ares_fds(3): mark as deprecated and add explanation (#691)
  
  ares_fds(3) is not safe to use, mark as deprecated.
  
  Fixes Issue: #687
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  autotools: fix building for 32bit windows due to stdcall symbol mangling (#689)
  
  Use AC_CHECK_DECL not AC_CHECK_FUNCS, while this doesn't do a linkage test, it just makes sure the headers define it, this is the only thing without a complex workaround on Windows that will do what we need.
  
  See:
  
  https://github.com/msys2/msys2/wiki/Porting/f87a222118b1008ebc166ad237f04edb759c8f4c#calling-conventions-stdcall-and-autotools
  
  and
  
  https://lists.gnu.org/archive/html/autoconf/2013-05/msg00085.html
  
  and for a more complex workaround, we'd need to use AC_LINK_IFELSE like:
  
  https://mailman.videolan.org/pipermail/vlc-devel/2015-March/101802.html
  
  which would require we check each individually and provide function arguments for the test.  I don't think that is worthwhile.
  
  Fixes Issue: #688
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Do not sanity check RR Name vs Question (#685)
  
  It appears as though we should never sanity check the RR name vs the question name as some DNS servers may return results for alias records.
  
  Fixes Bug: #683
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  no reason to include sys/random.h all the time (#684)
  
  External integrations don't need sys/random.h in order to compile, remove the dependency.  Try to fix building on legacy MacOS versions.
  
  Fixes Issue: #682
  Fix By: Brad House (@bradh352)

- [Gregor Jasny brought this change]

  cmake: improve some include related code (#680)
  
  * cmake: avoid warning about non-existing include dir
  
  In the Debian build logs I noticed the following warning:
  cc1: warning: /build/c-ares-1.25.0/test/include: No such file or directory [-Wmissing-include-dirs]
  
  This happened because ${CMAKE_INSTALL_INCLUDEDIR} had been added to
  caresinternal. I believe it has been copied from the "real" lib
  where it's used in the INSTALL_INTERFACE context. But because
  caresinternal is never installed we don't need that include here.
  
  * cmake: drop CARES_TOPLEVEL_DIR variable
  
  The CARES_TOPLEVEL_DIR variable is the same as the automatically
  created PROJECT_SOURCE_DIR variable. Let's stick to the official
  one. Also because it is already used at places where CARES_TOPLEVEL_DIR
  is used as well.
  
  Fix By: Gregor Jasny (@gjasny)

Brad House (5 Jan 2024)
- test: fix outdated license headers

- RELEASE-NOTES -> RELEASE-NOTES.md

- update format slightly

- update release notes format

Version 1.25.0 (2 Jan 2024)

GitHub (2 Jan 2024)
- [Brad House brought this change]

  1.25.0 release prep (#676)

Brad House (31 Dec 2023)
- tests: replace google DNS with CloudFlare for reverse lookups as google's servers stopped responding properly

- OSSFuzz: it assumes autotools builds a static library by default, which means the old autotools must have done that even though there were comments saying it wasn't.  Disable static by default on Windows however since it can't build both simultaneously.

- autotools: update logic for building tests to provide more feedback

- set winver consistently across build systems

GitHub (28 Dec 2023)
- [Brad House brought this change]

  Autotools: rework to simplify and fix recent issues (#674)
  
  Completely rework the autotools build system, issues have cropped up due to the complexity and could cause issues on even semi-modern Linux systems (Ubuntu 20.04 for example).
  
  Changes include:
  
  Remove all curl/xc/cares m4 helper files, they go overboard on detections of functions and datatypes. Go back to more plain autoconf macros as they've come a long way over the years.
  Use known systems and heuristics to determine datatypes for functions like send() and recv(), rather than the error prone detection which required thousands of permutations and might still get it wrong.
  Remove unneeded configure arguments like --enable-debug or --enable-optimize, its more common for people to simply pass their own CFLAGS on the command line.
  Only require CARES_STATICLIB definition on Windows static builds, its not necessary ever for other systems, even when hiding non-public symbols.
  Remove some function and definition detections that were never used in c-ares
  The test framework is now embedded into the toplevel configure system, there was no need to chain build the test system as it is never built externally to c-ares.
  As a side-effect of the changes, a configure run completes in about 25% of the original time.
  
  This has been tested on various Linux distributions (of varying age), FreeBSD, MacOS, Windows (via MSYS2 with Mingw), and Solaris10/11 (by @dfandrich), AIX 7.3 (by @dfandrich). It is not unlikely that this may have broken more esoteric or legacy systems, and we'll likely need to be ready to accept bug reports and patches, but it has removed over 10k lines of build system code. It is very likely any issues that crop up will add far fewer lines of code to fix such systems.
  
  Fixes Bug: #670
  Fix By: Brad House (@bradh352)

Brad House (22 Dec 2023)
- docs: host -> ip
  
  fix mismatched documentation stating host instead of ip
  
  Fix By: Brad House (@bradh352)

GitHub (21 Dec 2023)
- [Brad House brought this change]

  Old MacOS SDKs require you include sys/socket.h before net/if.h (#673)
  
  Old MacOS SDKs (like 10.8) require you include `sys/socket.h` before you include `net/if.h` as reported by MacPorts.  Using a new SDK but with setting the macos target version does not have the same issue.
  
  Fixes Issue: #672
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Autotools warning fixes (#671)
  
  * get rid of clashes with curl namespace
  * remove warnings due to deprecated functionality
  * reorder some macro calls to get rid of warnings due to being called in the wrong order
  
  Fix By: Brad House (@bradh352)

Brad House (19 Dec 2023)
- clang-format

- ares_strsplit() rewrite as wrapper around ares__buf_split()
  
  We want to limit as much as possible any hand written parsers.
  ares__buf_split() uses the new memory-safe parsing routines.  This
  adds a couple of additional flags to remove duplicates which the
  existing split code did.
  
  Fix By: Brad House (@bradh352)

- clang-format

- sonarcloud: const

- Connection failure should increment server failure count first
  
  In order to be sure a different server is chosen on the next query,
  a read error should result in the failure count being updated
  first before requeing the request to a different server.
  
  Fix By: Brad House (@bradh352)

GitHub (18 Dec 2023)
- [Brad House brought this change]

  ahost should use ares_getaddrinfo() these days (#669)
  
  ahost wasn't printing both ipv4 and ipv6 addresses. This day and age, it really should.
  
  This PR also adds the ability to specify the servers to use.
  
  Fix By: Brad House (@bradh352)

Brad House (17 Dec 2023)
- Fix bad stub for ares__iface_ips_enumerate()
  
  If the ability to enumerate interface ip addresses does not exist
  on a system, the stub function contained the wrong prototype.
  
  Fixes Bug: #668
  Fix By: Brad House (@bradh352)

GitHub (17 Dec 2023)
- [Gregor Jasny brought this change]

  Fix minor warnings and documentation typos (#666)
  
  Build warnings could be seen [here](https://buildd.debian.org/status/fetch.php?pkg=c-ares&arch=arm64&ver=1.24.0-1&stamp=1702826366&raw=0) [origin](https://buildd.debian.org/status/package.php?p=c-ares)
  
  Fix By: Gregor Jasny (@gjasny)

- [Brad House brought this change]

  CI: Add Alpine Linux and old Ubuntu (#667)
  
  Alpine linux doesn't use glibc but instead musl c, so provides a good alternative test bed. We are also adding the oldest non-EOL ubuntu version so we can test against older linux variants to prevent surprises.
  
  This patch also migrates more tests to use cmake and ninja in order to reduce overall build times as we seem to run out of credits on Cirrus-CI pretty quickly.
  
  Fix By: Brad House (@bradh352)

Brad House (17 Dec 2023)
- fix support with older google test versions

- getrandom() may require sys/random.h on some systems
  
  There is a reported build issue where getrandom() is detected
  but compile fails due to a missing prototype. This commit attempts
  to resolve that issue.
  
  Fixes Bug: #665
  Fix By: Brad House (@bradh352)

GitHub (17 Dec 2023)
- [Martin Chang brought this change]

  Use SOCK_DNS extension on socket on OpenBSD (#659)
  
  This patch added the `SOCK_DNS` flag when running on OpenBSD. Allowing a reduced set of `pledge(2)` promises. Before this patch. The "stdio rpath inet" promises must be used in order to resolve any records. After the patch inet can be replaced with dns which only allows communication on destination port 53, instead of on all ports.
  
  Side note: I checked the OpenBSD kernel source code. Even though the socket document says the DNS port (typically 53)., The OpenBSD 7.4 kernel only allows 53.
  
  Fix By: Martin Chang (@marty1885)

Brad House (17 Dec 2023)
- ci: disable static for symbol hiding tests

- ci: add test case for building with hidden symbol visibility

- fix test building with symbol hiding
  
  New test cases depend on internal symbols for calculating timeouts.
  Disable those test features if symbol hiding is enabled.
  
  Fixes Bug: #664
  Fix By: Brad House (@bradh352)

Version 1.24.0 (16 Dec 2023)

GitHub (16 Dec 2023)
- [Brad House brought this change]

  ares_cancel() could trigger callback with wrong response code (#663)
  
  When doing ares_gethostbyname() or ares_getaddrinfo() with AF_UNSPEC, if ares_cancel() was called after one address class was returned but before the other address class, it would return ARES_SUCCESS rather than ARES_ECANCELLED.
  
  Test case has been added for this specific condition.
  
  Fixes Bug: #662
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  rand: allow fallback from OS (#661)
  
  getrandom() can fail with ENOSYS if the libc supports the function but the kernel does not.
  
  Fixes Bug: #660
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  1.24.0 release prep (#657)

Brad House (11 Dec 2023)
- reference alternative to ares_getsock() in docs

- tag some functions as deprecated in docs

- Coverity: fix allocation size as reported in new code

- remove dead code: ares_iphlpapi.h

- remove dead code: bitncmp

GitHub (9 Dec 2023)
- [Brad House brought this change]

  Use external GoogleTest instead of bundling it (#655)
  
  GoogleTest should be unbundled. Google changed their guidance a few years back and modern versions of google test cannot build the bundling code file.
  
  This PR also updates to use C++14 as is required by modern GoogleTest versions.
  
  Fixes Bug: #506
  Fix By: Brad House (@bradh352)

Brad House (8 Dec 2023)
- use IF_NAMESIZE instead of IFNAMSIZ to avoid warning

- remove redundant cast

- clang-format and fix one warning

GitHub (8 Dec 2023)
- [Brad House brought this change]

  Clean up some Windows-only warnings (#654)
  
  Windows was emitting some warnings due to datatype differences.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Rewrite sortlist hand parser for memory safety and bugs (#653)
  
  The parser for the sortlist has been rewritten to use the ares__buf_*() functions. This also resolves some known bugs in accepting invalid sortlist entries which should have caused parse failures.
  
  Fixes Bug: #501
  Fix By: Brad House (@bradh352)

Brad House (8 Dec 2023)
- enhance timeout test case to make sure it will re-use a previously downed server

- enhance timeout test case

- SonarCloud: make const

GitHub (7 Dec 2023)
- [Brad House brought this change]

  increment failures on timeout (#651)
  
  As of c-ares 1.22.0, server timeouts were erroneously not incrementing server failures meaning the server in use wouldn't rotate.  There was apparently never a test case for this condition.
  
  This PR fixes the bug and adds a test case to ensure it behaves properly.
  
  Fixes Bug: #650
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Windows UBSAN tests (#649)
  
  Fix UBSAN error, and enable UBSAN testing in AppVeyor.
  
  Fixes Bug #648
  Fix By: Gisle Vanem (@gvanem)

- [Brad House brought this change]

  Support ipv6 link-local servers and %iface syntax (#646)
  
  Some environments may send router advertisements on a link setting their link-local (fe80::/10) address as a valid DNS server to the remote system.  This will cause a DNS entry to be created like `fe80::1%iface`, since all link-local network interfaces are technically part of the same /10 subnet, it must be told what interface to send packets through explicitly if there are multiple physical interfaces.
  
  This PR adds support for the %iface modifier when setting DNS servers via `/etc/resolv.conf` as well as via `ares_set_servers_csv()`.
  
  For MacOS and iOS it is assumed that libresolve will set the `sin6_scope_id` and should be supported, but my test systems don't seem to read the Router Advertisement for RDNSS link-local.  Specifying the link-local dns server on MacOS via adig has been tested and confirmed working.
  
  For Windows, this is similar to MacOS in that the system doesn't seem to honor the RDNSS RA, but specifying manually has been tested to work.
  
  At this point, Android support does not exist.
  
  Fixes Bug #462
  Supersedes PR #463
  
  Fix By: Brad House (@bradh352) and Serhii Purik (@sergvpurik)

Brad House (4 Dec 2023)
- silence openwatcom warning due to qcache_max_ttl being unsigned

- ares__round_up_pow2() work around bogus warning
  
  On 32bit systems, a codeblock that would intentionally never
  be executed was emitting a warning.  Rework the code to
  prevent the warning.  More code, no behavior difference, but
  keeps people from complaining about the warning...
  
  Fixes Bug: #645
  Fix By: Brad House (@bradh352)

- try to move AC_USE_SYSTEM_EXTENSIONS

- Enable system extensions
  
  Certain defines are needed on some systems to enable functionality like
  pthread recursive mutexes.
  
  Fixes #644
  Fix By: Brad House (@bradh352)

- ares_init_options() with invalid options values should unset the option
  
  Apparently nodejs is relying on the above behavior for legacy reasons.  Add
  sanity checks to the various optmask parameters where it makes sense.
  
  See https://github.com/nodejs/node/pull/50800
  
  Fix By: Brad House (@bradh352)

- SonarCloud: silence bogus reported error

- clang-format

GitHub (2 Dec 2023)
- [Brad House brought this change]

  Nameserver parsing: replace another hand-written parser (#643)
  
  This replaces the nameserver parsing code with code that use ares__buf_*() in the name of memory safety.
  
  Fix By: Brad House (@bradh352)

Version 1.23.0 (28 Nov 2023)

GitHub (28 Nov 2023)
- [Brad House brought this change]

  1.23.0 release prep (#641)

Brad House (28 Nov 2023)
- add missing manpage to distribution list

- clang-format

- remove a simply

- fix doc typo

- ares_init_options with ARES_OPT_UDP_PORT wrong byte order
  
  Regression from c-ares 1.19.1, ARES_OPT_UDP_PORT and ARES_OPT_TCP_PORT are
  specified from the user in host-byte order, but there was a regression that
  caused it to be read as if it was network byte order.
  
  Fixes Bug: #640
  Reported By: @Flow86
  Fix By: Brad House (@bradh352)

- fix ares_threadsafety() prototype

GitHub (28 Nov 2023)
- [Brad House brought this change]

  Basic Thread Safety (#636)
  
  c-ares does not have any concept of thread-safety. It has always been 100% up to the implementor to ensure they never call c-ares from more than one thread at a time. This patch adds basic thread-safety support, which can be disabled at compile time if not desired. It uses a single recursive mutex per channel, which should be extremely quick when uncontested so overhead should be minimal.
  
  Fixes Bug: #610
  
  Also sets the stage to implement #611
  
  Fix By: Brad House (@bradh352)

- [petrvh brought this change]

  ares_getaddrinfo(): do not use search domains if ARES_FLAG_NOSEARCH is set (#638)
  
  c-ares init options defines a flag ARES_FLAG_NOSEARCH that is supposed to prevent search using configured domain suffixes, however when using ares_getaddrinfo() the flag was ignored and domain suffixes were used anyway.
  
  Configuring zero domains to search also does not work (if ndomains == 0 default domain search list is loaded regardless of the flag ARES_OPT_DOMAINS being set).
  
  This change adds a check for the ARES_FLAG_NOSEARCH in as_is_only() function that is used by ares_getaddrinfo() to decide if to try to query next possible name ( next_dns_lookup() )
  
  Fix By: @petrvh

Brad House (25 Nov 2023)
- Fix MacOS version test
  
  It appears that the Issue #454 wasn't really fixed for some reason.  This commit should fix the detection.
  
  Fix By: Brad House (@bradh352)

Daniel Stenberg (24 Nov 2023)
- CI: codespell
  
  Closes #635

GitHub (24 Nov 2023)
- [Christian Clauss brought this change]

  Fix typos discovered by codespell (#634)
  
  % `codespell --ignore-words-list="aas,aci,acter,atleast,contentss,firey,fo,sais,seh,statics"`
  * https://pypi.org/project/codespell
  
  Fix By: Christian Clauss (@cclauss)

Brad House (22 Nov 2023)
- environment is meant as an override for sysconfig

GitHub (22 Nov 2023)
- [Ignat brought this change]

  Support attempts and timeout options from resolv.conf (#632)
  
  c-ares parses only antique version of options for timeout and number of retries from resolv.conf (`retrans` and `retry` are missing in modern documentation https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
  
  I add support of `attempts` and `timeout` options
  
  Fix By: Ignat (@Kontakter)

- [Brad House brought this change]

  more precise timeout calculation (#633)
  
  The timeout calculation was occurring with millisecond precision, but on some systems, there is microsecond precision which could mean we'd tell a user a timeout time prior to the actual timeout.
  
  Fixes Bug: #631
  Fix By: Brad House (@bradh352)

- [Christian Clauss brought this change]

  INSTALL.md: Fix typo (#630)
  
  Fix By: Christian Clauss (@cclauss)

Brad House (19 Nov 2023)
- SonarCloud: fix minor codesmells

- fix test case regression due to missing parens

- now that warnings are enabled on test cases, clear a bunch of warnings

- CMake: CXXFLAGS environment wasn't being read because C++ compiler was enabled after settings warnings.

- fix additional windows test warnings

- cleanup some Windows warnings in test

- clang-format

GitHub (19 Nov 2023)
- [Brad House brought this change]

  Fix Windows UWP (Store) building and add to CI/CD (#627)
  
  When building for UWP (WindowsStore), additional headers are needed and some functions are not available. This also adds AppVeyor CI/CD support to catch these issues in the future.
  
  Fix By: Deal (@halx99) and Brad House (@bradh352)

Brad House (19 Nov 2023)
- ares_set_servers_*() should allow an empty server list
  
  For historic reasons, we have users depending on ares_set_servers_*()
  to return ARES_SUCCESS when passing no servers and actually *clear*
  the server list.  It appears they do this for test cases to simulate
  DNS unavailable or similar.  Presumably they could achieve the same
  effect in other ways (point to localhost on a port that isn't in use).
  But it seems like this might be wide-spread enough to cause headaches
  so we just will document and test for this behavior, clearly it hasn't
  caused "issues" for anyone with the old behavior.
  
  See: https://github.com/nodejs/node/pull/50800
  
  Fix By: Brad House (@bradh352)

GitHub (19 Nov 2023)
- [Brad House brought this change]

  Query Cache support (#625)
  
  This PR implements a query cache at the lowest possible level, the actual dns request and response messages.  Only successful and `NXDOMAIN` responses are cached. The lowest TTL in the response message determines the cache validity period for the response, and is capped at the configuration value for `qcache_max_ttl`.  For `NXDOMAIN` responses, the SOA record is evaluated.
  
  For a query to match the cache, the opcode, flags, and each question's class, type, and name are all evaluated.  This is to prevent matching a cached entry for a subtly different query (such as if the RD flag is set on one request and not another).
  
  For things like ares_getaddrinfo() or ares_search() that may spawn multiple queries, each individual message received is cached rather than the overarching response.  This makes it possible for one query in the sequence to be purged from the cache while others still return cached results which means there is no chance of ever returning stale data.
  
  We have had a lot of user requests to return TTLs on all the various parsers like `ares_parse_caa_reply()`, and likely this is because they want to implement caching mechanisms of their own, thus this PR should solve those issues as well.
  
  Due to the internal data structures we have these days, this PR is less than 500 lines of new code.
  
  Fixes #608
  
  Fix By: Brad House (@bradh352)

Version 1.22.1 (17 Nov 2023)

GitHub (17 Nov 2023)
- [Brad House brought this change]

  1.22.1 release prep (#624)

Brad House (17 Nov 2023)
- ares__htable_strvp should be case-insensitive

- optimize: large /etc/hosts files reading
  
  profiling found some hot paths that could be optimized to reduce
  insert times into the cache.
  
  Fix By: Brad House (@bradh352)

- Fix /etc/hosts processing performance with all entries using same IP address
  
  Some users use blacklist files like https://github.com/StevenBlack/hosts which
  can contain 200k+ host entries all pointing to 0.0.0.0.  Due to the merge
  logic in the new hosts processor, all those entries will be associated as
  aliases for the same ip address.
  
  The first issue is that it attempts to check the status of all the hosts for
  the merged entry, when it should only be checking the new hosts added to the
  merged entry, so this caused exponential time as the entries got longer.
  
  The next issue is if searching for one of those hosts, it would append all
  the matches as cnames/aliases, but there is zero use for 200k aliases
  being appended to a lookup, so we are artificially capping this to 100.
  
  Bug report reference: https://bugs.gentoo.org/917400
  
  Fix By: Brad House (@bradh352)

- new badges

- OpenWatcom: time_t is unsigned, change math using time_t to promote to a 64bit signed integer

- fix more docs

GitHub (15 Nov 2023)
- [Gregor Jasny brought this change]

  Fix typos and man page whatis entry (#619)
  
  Those issues were detected by lintian.
  
  Fix By: Gregor Jasny (@gjasny)

- [Douglas R. Reno brought this change]

  Fix building c-ares-1.22.0 and higher under Watcom. (#623)
  
  Update config-win32.h to define HAVE_STDINT_H when OpenWatcom is in use.
  
  Fix By: Douglas R. Reno (@renodr)

Brad House (15 Nov 2023)
- OpenWatcom: fix PR building

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- CI/CD: Add OpenWatcom

- warnings: try to prevent warnings due to automatic integer promotion

- only push to coverity weekly or on explicit coverity_scan branch commits

- try to cleanup bogus compiler warnings

- try to cleanup bogus compiler warnings

- additional test coverage

- Coverity: omit tests

- Coverity: more

- Coverity: silence false positives

Version 1.22.0 (14 Nov 2023)

Brad House (14 Nov 2023)
- fix workflow

- try a different coverity workflow

GitHub (14 Nov 2023)
- [Brad House brought this change]

  coverity workflow (#618)

Brad House (14 Nov 2023)
- typos

- getaddrinfo ESERVICE

GitHub (14 Nov 2023)
- [Brad House brought this change]

  Release 1.22.0 (#616)

Brad House (13 Nov 2023)
- SonarCloud: minor codesmells

- clang-format

- Extended RCODE in OPT RR PsuedoRecord should not be exposed directly, it should be presented as part of the normal rcode

- Slight fixes for PR #615
  
  1. the maxtimeout must come at the end of the structure
  2. fix comment form to be C style
  3. fix timeplus randomness if statement

GitHub (13 Nov 2023)
- [Brad House brought this change]

  Add DNS record manpages (#615)
  
  The new DNS record parser and writer needs manpages. This PR implements those.
  
  Fix By: Brad House (@bradh352)

- [Ignat brought this change]

  Randomize retry penalties to prevent thundering herd type issues (#606)
  
  The retry timeout values were using a fixed calculation which could cause multiple simultaneous queries to timeout and retry at the exact same time.  If a DNS server is throttling requests, this could cause the issue to never self-resolve due to all requests recurring at the same instance again.
  
  This PR also creates a maximum timeout option to make sure the random value selected does not exceed this value.
  
  Fix By: Ignat (@Kontakter)

Brad House (13 Nov 2023)
- fix typos

- some simplification and better error handling

- SonarCloud: fix some minor codesmells

GitHub (12 Nov 2023)
- [Brad House brought this change]

  Implement ares_reinit() to reload system configuration into existing channel (#614)
  
  This PR implements ares_reinit() to safely reload a channel's configuration even if there are existing queries.  This function can be called when system configuration is detected to be changed, however since c-ares isn't thread aware, care must be taken to ensure no other c-ares calls are in progress at the time this function is called.  Also, this function may update the open file descriptor list so care must also be taken to wake any event loops and reprocess the list of file descriptors.
  
  Fixes Bug #301
  
  Fix By: Brad House (@bradh352)

Brad House (11 Nov 2023)
- test case ensures tag for caa is not blank

- 0-length strings are ok

- SonarCloud: fix up codesmells

GitHub (11 Nov 2023)
- [Brad House brought this change]

  rewrite adig using new helpers (#607)
  
  adig previously performed manual parsing of the DNS records.  Now it can focus strictly on formatting of output data for printing.  It simply iterates across the parsed DNS packet and queries for the RRs, parameters for each RR, and the datatypes for each parameter.  adig will now automatically pick up new RRs from the c-ares library due to the dynamic nature.
