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

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.
  
  The adig format also now more closely resembles that of BIND's `dig` output.
  
  A few more helpers needed to be added to the c-ares library that were missing.  There ware a couple of minor bugs and enhancements also needed.
  
  Example:
  ```
  ./adig -t ANY www.google.com
  
  ; <<>> c-ares DiG 1.21.0 <<>> www.google.com
  ;; Got answer:
  ;; ->>HEADER<<- opcode: QUERY, status: RCODE, id: 23913
  ;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 1
  
  ;; OPT PSEUDOSECTION:
  ; EDNS: version: 0, flags: 0; udp: 512
  ;; QUESTION SECTION:
  ;www.google.com.                        IN      ANY
  
  ;; ANSWER SECTION:
  www.google.com.         162     IN      A       142.251.107.99
  www.google.com.         162     IN      A       142.251.107.105
  www.google.com.         162     IN      A       142.251.107.103
  www.google.com.         162     IN      A       142.251.107.147
  www.google.com.         162     IN      A       142.251.107.104
  www.google.com.         162     IN      A       142.251.107.106
  www.google.com.         162     IN      AAAA    2607:f8b0:400c:c32::93
  www.google.com.         162     IN      AAAA    2607:f8b0:400c:c32::69
  www.google.com.         162     IN      AAAA    2607:f8b0:400c:c32::68
  www.google.com.         162     IN      AAAA    2607:f8b0:400c:c32::6a
  www.google.com.         21462   IN      HTTPS   1 . alpn="h2,h3"
  
  ;; MSG SIZE  rcvd: 276
  ```
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  make dns parser/writer public (#604)
  
  This PR makes the c-ares parser introduced in 1.21, and the new writer, along with associated helpers public.  These helpers are contained in a new public header of `ares_dns_record.h` which should _**not**_ be included directly, instead simply including `ares.h` is sufficient.  This will address #587, as well as #470.
  
  A follow-up PR will be made which will transform `adig` to use the new parsers and helpers.
  
  This PR does not currently add man pages for these public functions, that will be in a follow-up PR once the `adig` migration is done which may expose additional needed helpers.
  
  The two aforementioned PRs will be done before the 1.22 release.
  
  Fix By: Brad House (@bradh352)

Brad House (9 Nov 2023)
- options helpers: fix dereference to properly return params

- clang-format

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

  Add SVCB and HTTPS RR (RFC 9460) (#603)
  
  This PR adds parsing and writing support for SVCB and HTTPS RRs as defined in RFC 9460.
  
  This should fix #566
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  OPT RR should support parsing key/value options (#602)
  
  The OPT RR record has some seldom used options with a 16bit key and a binary value.  The current parser and writer was not supporting this.  This PR adds support.  The same format is also used for SVCB/HTTPS records, so getting this in there is necessary to support that RR type.
  
  Also, we split the Binary record format into BIN and BINP, where BINP is an indicator that the binary data is _likely_ printable and will guarantee a NULL terminator.  This is helpful for those attempting to print RRs.
  
  Fix By: Brad House (@bradh352)

Brad House (8 Nov 2023)
- SonarCloud: fix some easy codesmells

- clang-format

- Mark a couple of parameters as const in the public API

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

  Add TLSA record support (#600)
  
  As per #470, c-ares is missing a parser for the TLSA record format (RFC 6698). This PR introduces that parser.
  
  Once the new parser interface becomes public and this PR is merged, then #470 can be closed.
  
  Fix By: Brad House (@bradh352)

Brad House (7 Nov 2023)
- memory leak in test case

- fix bad variable reference

- DNS Write: fix name compression

- SonarCloud: fix codesmells

- Coverage: add tests for writing and parsing various record formats

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

  DNS Record Write (#598)
  
  The `ares_dns_record_t` data structure created in the prior release is capable of holding a complete parsed DNS message and also provides all helpers in order to fill in the data structure.  This PR adds write capabilities for this data structure to form a complete message and supports features such as DNS name compression as defined in RFC1035.  Though this message writing capability goes further than c-ares internally needs, external users may find it useful ... and we may find it useful for test validation as well.
  
  This also replaces the existing message writing code in `ares_create_query()`, as well rewriting the request message without EDNS in ares_process.c's `process_answer()`.
  
  Fix By: Brad House (@bradh352)

Brad House (6 Nov 2023)
- PATH_RESOLV_CONF: use empty string instead of NULL to prevent warnings

- build fix

- const: fix some usecases

- remove tests that depend on randomness

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

  Use EDNS by default (#596)
  
  All DNS servers support EDNS, by using this by default, it will allow larger responses without the need to switch to TCP. If by chance a DNS server is hit that doesn't support EDNS, this is detected due to the lack of the OPT RR in the response and will be automatically retried without EDNS.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  `ares_channel` -> `ares_channel_t *`: don't bury the pointer (#595)
  
  `ares_channel` is defined as `typedef struct ares_channeldata *ares_channel;`.  The problem with this, is it embeds the pointer into the typedef, which means an `ares_channel` can never be declared as `const` as if you write `const ares_channel channel`, that expands to `struct ares_channeldata * const ares_channel` and not `const struct ares_channeldata *channel`.
  
  We will now typedef `ares_channel_t` as `typedef struct ares_channeldata ares_channel_t;`, so if you write `const ares_channel_t *channel`, it properly expands to `const struct ares_channeldata *channel`.
  
  We are maintaining the old typedef for API compatibility with existing integrations, and due to typedef expansion this should not even cause any compiler warnings for existing code.  There are no ABI implications with this change.  I could be convinced to keep existing public functions as `ares_channel` if a sufficient argument exists, but internally we really need make this change for modern best practices.
  
  This change will allow us to internally use `const ares_channel_t *` where appropriate.  Whether or not we decide to change any public interfaces to use `const` may require further discussion on if there might be ABI implications (I don't think so, but I'm also not 100% sure what a compiler internally does with `const` when emitting machine code ... I think more likely ABI implications would occur going the opposite direction).
  
  FYI, This PR was done via a combination of sed and clang-format, the only manual code change was the addition of the new typedef, and a couple doc fixes :)
  
  Fix By: Brad House (@bradh352)

Brad House (4 Nov 2023)
- win32 warnings look good, remove commented out block

- more msvc warnings

- fix

- docs: document setting servers can be done live

- SonarCloud: more easy codesmells

- clang-format

- SonarCloud: fix up codesmells

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

  Dynamic Server List (#594)
  
  This PR makes the server list a dynamic sorted list of servers. The sort order is [ consecutive failures, system config index ]. The server list can be updated via ares_set_servers_*(). Any queries currently directed to servers that are no longer in the list will be automatically re-queued to a different server.
  
  Also, any time a failure occurs on the server, the sort order of the servers will be updated so that the one with the fewest consecutive failures is chosen for the next query that goes on the wire, this way bad or non-responsive servers are automatically isolated.
  
  Since the server list is now dynamic, the tracking of query failures per server has been removed and instead is relying on the server sort order as previously described. This simplifies the logic while also reducing the amount of memory required per query. However, because of this dynamic nature, it may not be easy to determine the server attempt order for enqueued queries if there have been any failures.
  
  If using the ARES_OPT_ROTATE, this is now implemented to be a random selection of the configured servers. Since the server list is dynamic, its not possible to go to the next server as configuration could have changed between queries or attempts for the same query.
  
  Finally, this PR moved some existing functions into new files to logically separate them.
  
  This should address issues #550 and #440, while also setting the framework to implement #301. #301 needs a little more effort since it configures things other than the servers themselves (domains, search, sortlist, lookups), which need to make sure they can be safely updated.
  
  Fix By: Brad House (@bradh352)

Brad House (1 Nov 2023)
- no reason to run LSAN, ASAN already does it

GitHub (31 Oct 2023)
- [Brad House brought this change]

  AppVeyor: update compiler versions, use Msys2, and Windows fixes (#593)
  
  AppVeyor was using Visual Studio 2015 along with old versions of MinGW. Update to the latest AppVeyor provides and also add an MSYS2 build test using MinGW which will use the bleeding edge version.
  
  When researching #590 this also uncovered a bug in cmake not properly detecting if_indextoname() on windows. This has been corrected as well as the underlying issue reported in #590.
  
  Fix By: Brad House (@bradh352) and Jonas Kvinge (@jonaski)

Brad House (31 Oct 2023)
- Coverage: add some code misuse test cases

- hosts file parsing should set success at end of loop

- fix windows localhost for ares_gethostbyname_file() when /etc/hosts doesn't have an entry

- SonarCloud: fix up codesmells (const, unneeded casts, reduce complexity)

GitHub (30 Oct 2023)
- [Brad House brought this change]

  Replace hosts parser, add caching capabilities (#591)
  
  HOSTS FILE PROCESSING OVERVIEW
  ==============================
  The hosts file on the system contains static entries to be processed locally
  rather than querying the nameserver.  Each row is an IP address followed by
  a list of space delimited hostnames that match the ip address.  This is used
  for both forward and reverse lookups.
  
  We are caching the entire parsed hosts file for performance reasons.  Some
  files may be quite sizable and as per Issue #458 can approach 1/2MB in size,
  and the parse overhead on a rapid succession of queries can be quite large.
  The entries are stored in forwards and backwards hashtables so we can get
  O(1) performance on lookup.  The file is cached until the file modification
  timestamp changes (or 60s if there is no implemented stat() capability).
  
  The hosts file processing is quite unique. It has to merge all related hosts
  and ips into a single entry due to file formatting requirements.  For
  instance take the below:
  ```
  127.0.0.1    localhost.localdomain localhost
  ::1          localhost.localdomain localhost
  192.168.1.1  host.example.com host
  192.168.1.5  host.example.com host
  2620:1234::1 host.example.com host6.example.com host6 host
  ```
  This will yield 2 entries.
  1) ips: `127.0.0.1,::1`
      hosts: `localhost.localdomain,localhost`
  2) ips: `192.168.1.1,192.168.1.5,2620:1234::1`
      hosts: `host.example.com,host,host6.example.com,host6`
  
  It could be argued that if searching for `192.168.1.1` that the `host6`
  hostnames should not be returned, but this implementation will return them
  since they are related (both ips have the fqdn of host.example.com).  It is
  unlikely this will matter in the real world.
  
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  cleanups: split functions out into different files, rename some to be more logical (#589)

Brad House (27 Oct 2023)
- fix comment

- recursive git attributes

Version 1.21.0 (26 Oct 2023)

Brad House (26 Oct 2023)
- SonarCloud: reduce reported complexity that exists for no reason.

- SonarCloud: fix some #undef codesmells

- formatting

- document ARES_RR_* records

- no reason to limit on truncation

- linguist fixes

- don't use test cases to determine language of c-ares

- fix grammar

- fix count

GitHub (25 Oct 2023)
- [Brad House brought this change]

  1.21.0 release prep (#585)

Brad House (25 Oct 2023)
- fix build warning

GitHub (25 Oct 2023)
- [Brad House brought this change]

  SonarCloud: clean up more codesmells (#584)

Brad House (25 Oct 2023)
- resolve reported memory leaks

- add test vector said to cause a memory leak

GitHub (25 Oct 2023)
- [Brad House brought this change]

  sonarcloud: fix more codesmells (#583)

- [Brad House brought this change]

  sonarcloud easy codesmells (#582)
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Modernization: replace multiple hand-parsers with new memory-safe parser (#581)
  
  New DNS record parsing code. The old code was basically just some helper macros and functions for parsing an entire DNS message. The caller had to know the RFCs to use the parsers, except for some pre-made exceptions. The new parsing code parses the entire DNS message into an opaque data structure in a memory safe manner with various accessors for reading and manipulating the data.
  
  The existing parser helpers for the various record types were reimplemented as wrappers around the new parser.
  
  The accessors allow easy iteration across the DNS record datastructure, and can be used to easily create dig-like output without needing to know anything about the various record types and formats as dynamic helpers are provided for enumeration of values and data types of those values.
  
  At some point in the future, this new DNS record structure, accessors, and parser will be exposed publicly. This is not done at this point as we don't want to do that until the API is completely stable. Likely a write() function to output the DNS record back into an actual message buffer will be introduced with the stable API as well.
  
  Some subtle bugs in the existing code were uncovered, some which had test cases which turned out to be bogus. Validation with third-party implementations (e.g. BIND9) were performed to validate such cases were indeed bugs.
  
  Adding additional RR parsers such as for TLSA (#470) or SVCB/HTTPS (#566) are trivial now since focus can be put on only parsing the data within the RR, not the entire message. That said, as the new parser is not yet public, it isn't clear the best way to expose any new RRs (probably best to wait for the new parser to be public rather than hacking in another legacy function).
  
  Some additional RRs that are part of DNS RFC1035 or EDNS RFC6891 that didn't have previously implemented parsers are now also implemented (e.g. HINFO, OPT). Any unrecognized RRs are encapsulated into a "RAW_RR" as binary data which can be inserted or extracted, but are otherwise not interpreted in any way.
  
  Fix By: Brad House (@bradh352)

- [Gregor Jasny brought this change]

  feat: use CMake to control symbol visibility (#574)
  
  In contrast to #572 this solution does not need any extra headers. But it is also limited to GCC-like compilers.
  
  Fix By: Gregor Jasny (@gjasny)

- [Brad House brought this change]

  remove ares_nowarn helpers #580
  
  Now that the code internally is using proper datatypes, there is no longer a need for ares_nowarn helpers. Remove them.
  
  Fix By: Brad House (@bradh352)

Brad House (16 Oct 2023)
- clang-format: fix structure alignment
  
  It appears the structure alignment chosen just doesn't work right.
  Switch to 'left', it appears to be mostly correct.
  
  Fix By: Brad House (@bradh352)

GitHub (15 Oct 2023)
- [Brad House brought this change]

  Reformat code using clang-format (#579)
  
  c-ares uses multiple code styles, standardize on one. Talking with @bagder he feels strongly about maintaining an 80 column limit, but feels less strongly about things I feel strongly about (like alignment).
  
  Can re-run the formatter on the codebase via:
  ```
  clang-format -i */*.c */*.h */*/*.c */*/*.h
  ```
  
  Fix By: Brad House (@bradh352)

Brad House (15 Oct 2023)
- inet_ntop requires ares_private.h

- SonarCloud: Fix additional code smells
  
  Fix By: Brad House (@bradh352)

- SonarCloud: Ignore codesmells c89 doesn't support
  
  C89 doesn't support iterator declaration in for loop, kill warning.
  
  Fix By: Brad House (@bradh352)

GitHub (15 Oct 2023)
- [Brad House brought this change]

  set compiler standard to ISO C90/ANSI C89 (#577)
  
  SonarCloud is outputting some code smells for things that aren't possible for C89. Hopefully setting the code standard to C89/C90 properly will fix those bogus warnings.
  
  Fix By: Brad House (@bradh352)

Brad House (15 Oct 2023)
- fix new ares_strcpy to ensure null termination

- build fix

GitHub (15 Oct 2023)
- [Brad House brought this change]

  SonarCloud: Fix up codesmells due to strlen(), strcpy(), and strncpy() (#576)
  
  Create ares_strlen() and ares_strcpy() in order to resolve SonarCloud codesmells related to their use.
  
  ares_strlen() just becomes null-safe.
  
  ares_strcpy() is equivalent to strlcpy(), so unlike strncpy() it guarantees NULL termination.
  
  Fix By: Brad House (@bradh352)

Brad House (15 Oct 2023)
- SonarCloud: try to appease it better

- SonarCloud: Fix reported bugs
  
  SonarCloud reported a few bugs, this commit should fix those reports.
  
  Fix By: Brad House (@bradh352)

GitHub (15 Oct 2023)
- [Brad House brought this change]

  Fix internal datatype usage and warnings (#573)
  
  PR #568 increased the warning levels and c-ares code emitted a bunch of warnings. This PR fixes those warnings and starts transitioning internal data types into more proper forms (e.g. data lengths should be size_t not int). It does, however, have to manually cast back to what the public API needs due to API and ABI compliance (we aren't looking to break integrations, just clean up internals).
  
  Fix By: Brad House (@bradh352)

Brad House (15 Oct 2023)
- SonarCloud: exclude tests

- fix source directories

GitHub (15 Oct 2023)
- [Brad House brought this change]

  Sonarcloud (#575)

- [Brad House brought this change]

  Increase compiler warnings by default (#568)
  
  c-ares was missing a couple of common compiler warnings during building that are widely recognized as a best practice. This PR makes no code changes, only build system changes to increase warning levels.
  
  This PR does cause some new warnings to be emitted, a follow-up PR will address those.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  introduce ares_bool_t datatype (#570)
  
  c-ares currently uses int for boolean, which can be confusing as there are some functions which return int but use '0' as the success condition. Some internal variable usage is similar. Lets try to identify the boolean use cases and split them out into their own data type of ares_bool_t. Since we're trying to keep C89 compatibility, we can't rely on stdbool.h or the _Bool C99 data type, so we'll define our own.
  
  Also, chose using an enum rather than say unsigned char or int because of the type safety benefits it provides. Compilers should warn if you try to pass, ARES_TRUE on to a ares_status_t enum (or similar) since they are different enums.
  
  Fix By: Brad House (@bradh352)

Brad House (12 Oct 2023)
- Socket callbacks were passed SOCK_STREAM instead of SOCK_DGRAM on udp
  
  A regression was introduced in 1.20.0 that would pass SOCK_STREAM on udp
  connections due to code refactoring.  If a client application validated this
  data, it could cause issues as seen in gRPC.
  
  Fixes Issue: #571
  Fix By: Brad House (@bradh352)

- Enhance test of ares_getsock()
  
  In an attempt to see if ares_getsock() was broken as per #571, do
  further sanity checks of the results of ares_getsock().  It seems
  as though ares_getsock() is fine.
  
  Fix By: Brad House (@bradh352)

GitHub (10 Oct 2023)
- [Brad House brought this change]

  Tool: STAYOPEN flag could make tools not terminate (#569)
  
  If a flag is set to keep the connections to the DNS servers open even if there are no queries, the tools would not exit until the remote server closed the connection due to the user of ares_fds() to determine if there are any active queries. Instead, rely on ares_timeout() returning NULL if there are no active queries (technically this returns the value passed to max_tv in ares_timeout(), but in our use case, that is always NULL).
  
  Fixes Issue: #452
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  ares_status_t enum for status codes (#567)
  
  The list of possible error codes in c-ares was a #define list. This not only doesn't provide for any sort of type safety but it also lacks clarification on what a function may return or what it takes, as an int could be an ares status, a boolean, or possibly even a length in the current code.
  
  We are not changing any public APIs as though the C standard states the underlying size and type of an enum is int, there are compiler attributes to override this as well as compiler flags like -fshort-enums. GCC in particular is known to expand an enum's width based on the data values (e.g., it can emit a 64bit integer enum).
  
  All internal usages should be changed by this PR, but of course, there may be some I missed.
  
  Fix By: Brad House (@bradh352)

Daniel Stenberg (9 Oct 2023)
- docs: provide better man page references
  
  When referring to another c-ares function use \fI function(3) \fP to let
  the webpage rendering find and cross-link them appropriately.
  
  SEE ALSO references should be ".BR name (3),", with a space before the
  open parenthesis. This helps the manpage to HTML renderer.
  
  Closes #565

Version 1.20.1 (8 Oct 2023)

GitHub (8 Oct 2023)
- [Daniel Stenberg brought this change]

  ares-test:  silence warning (#564)
  
  warning: comparison of integer expressions of different signedness
  
  Fix By: Daniel Stenberg (@bagder)

Brad House (8 Oct 2023)
- fix README.md

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

  1.20.1 release (#563)

- [Brad House brought this change]

  fix reference to freed memory (#562)
  
  Issue #561 shows free'd memory could be accessed in some error conditions.
  
  Fixes Issue #561
  Fix By: Brad House (@bradh352)

Brad House (8 Oct 2023)
- reported build/test systems may timeout on intensive tests. reduce test case to still be relevant but to reduce false positive errors

GitHub (8 Oct 2023)
- [Gregor Jasny brought this change]

  Regression: Fix typo in fuzzcheck target name (#559)
  
  This seems to be a vim'esque typo introduced with c1b00c41.
  
  Fix By: Gregor Jasny (@gjasny)

Version 1.20.0 (6 Oct 2023)

Brad House (6 Oct 2023)
- fix slist search off by 1

GitHub (6 Oct 2023)
- [Brad House brought this change]

  1.20.0 release prep (#557)

- [Brad House brought this change]

  ares__buf should return standard error codes.  more helpers implemented. (#558)
  
  The purpose of this PR is to hopefully make the private API of this set of routines less likely to need to be changed in a future release.  While this is not a public API, it could become harder in the future to change usage as it becomes more widely used within c-ares.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Update from 1989 MIT license text to modern MIT license text (#556)
  
  ares (and thus c-ares) was originally licensed under the 1989 MIT license text:
  https://fedoraproject.org/wiki/Licensing:MIT#Old_Style_(no_advertising_without_permission)
  
  This change updates the license to the modern MIT license as recognized here:
  https://opensource.org/license/mit/
  
  care has been taken to ensure correct attributions remain for the authors contained within the copyright headers, and all authors with attributions in the headers have been contacted for approval regarding the change.  Any authors which were not able to be contacted, the original copyright maintains, luckily that exists in only a single file `ares_parse_caa_reply.c` at this time.
  
  Please see PR #556 for the documented approvals by each contributor.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Test Harness: use ares_timeout() to calculate the value to pass to select() these days. (#555)
  
  The test framework was using 100ms timeout passed to select(), and not using ares_timeout() to calculate the actual recommended value based on the queries in queue. Using ares_timeout() tests the functionality of ares_timeout() itself and will provide more responsive results.
  
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Fix for TCP back to back queries (#552)
  
  As per #266, TCP queries are basically broken. If we get a partial reply, things just don't work, but unlike UDP, TCP may get fragmented and we need to properly handle that.
  
  I've started creating a basic parser/buffer framework for c-ares for memory safety reasons, but it also helps for things like this where we shouldn't be manually tracking positions and fetching only a couple of bytes at a time from a socket. This parser/buffer will be expanded and used more in the future.
  
  This also resolves #206 by allowing NULL to be specified for some socket callbacks so they will auto-route to the built-in c-ares functions.
  
  Fixes: #206, #266
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  remove acountry from built tools as nerd.dk is gone (#554)
  
  The acountry utility required a third party DNSBL service from nerd.dk in order to operate. That service has been offline for about a year and there is no other comparable service offering. We are keeping the code in the repository as an example, but no longer building it.
  
  Fixes: #537
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]

  Don't requeue any queries for getaddrinfo() during destruction. (#553)
  
  During ares_destroy(), any outstanding queries are terminated, however ares_getaddrinfo() had an ordering issue with status codes which in some circumstances could lead to a new query being enqueued rather than honoring the termination.
  
  Fixes #532
  Fix By: @Chilledheart and Brad House (@bradh352)

- [Brad House brought this change]

  ares_getaddrinfo(): Fail faster on AF_UNSPEC if we've already received one address class  (#551)
  
  As per #541, when using AF_UNSPEC with ares_getaddrinfo() (and in turn with ares_gethostbynam()) if we receive a successful response for one address class, we should not allow the other address class to continue on with retries, just return the address class we have.
  
  This will limit the overall query time to whatever timeout remains for the pending query for the other address class, it will not, however, terminate the other query as it may still prove to be successful (possibly coming in less than a millisecond later) and we'd want that result still. It just turns off additional error processing to get the result back quicker.
  
  Fixes Bug: #541
  Fix By: Brad House (@bradh352)

- [Sam Morris brought this change]

  Avoid producing an ill-formed result when qualifying a name with the root domain (#546)
  
  This prevents the result of qualifying "name" with "." being "name.." which is ill-formed.
  
  Fixes Bug: #545
  Fix By: Sam Morris (@yrro)

- [Brad House brought this change]

  Configuration option to limit number of UDP queries per ephemeral port (#549)
  
  Add a new ARES_OPT_UDP_MAX_QUERIES option with udp_max_queries parameter that can be passed to ares_init_options(). This value defaults to 0 (unlimited) to maintain existing compatibility, any positive number will cause new UDP ephemeral ports to be created once the threshold is reached, we'll call these 'connections' even though its technically wrong for UDP.
  
  Implementation Details:
  * Each server entry in a channel now has a linked-list of connections/ports for udp and tcp. The first connection in the list is the one most likely to be eligible to accept new queries.
  * Queries are now tracked by connection rather than by server.
  * Every time a query is detached from a connection, the connection that it was attached to will be checked to see if it needs to be cleaned up.
  * Insertion, lookup, and searching for connections has been implemented as O(1) complexity so the number of connections will not impact performance.
  * Remove is_broken from the server, it appears it would be set and immediately unset, so must have been invalidated via a prior patch. A future patch should probably track consecutive server errors and de-prioritize such servers. The code right now will always try servers in the order of configuration, so a bad server in the list will always be tried and may rely on timeout logic to try the next.
  * Various other cleanups to remove code duplication and for clarification.
  
  Fixes Bug: #444
  Fix By: Brad House (@bradh352)

- [Brad House brought this change]
