Skip to content

Commit

Permalink
deps: update c-ares to v1.32.3
Browse files Browse the repository at this point in the history
PR-URL: #54020
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
nodejs-github-bot authored and marco-ippolito committed Aug 19, 2024
1 parent 9a98ad4 commit 496975e
Show file tree
Hide file tree
Showing 24 changed files with 297 additions and 263 deletions.
4 changes: 2 additions & 2 deletions deps/cares/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
INCLUDE (CheckStructHasMember)
INCLUDE (CheckLibraryExists)

PROJECT (c-ares LANGUAGES C VERSION "1.32.2" )
PROJECT (c-ares LANGUAGES C VERSION "1.32.3" )

# Set this version before release
SET (CARES_VERSION "${PROJECT_VERSION}")
Expand All @@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
# For example, a version of 4:0:2 would generate output such as:
# libname.so -> libname.so.2
# libname.so.2 -> libname.so.2.2.0
SET (CARES_LIB_VERSIONINFO "19:2:17")
SET (CARES_LIB_VERSIONINFO "19:3:17")


OPTION (CARES_STATIC "Build as a static library" OFF)
Expand Down
26 changes: 26 additions & 0 deletions deps/cares/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## c-ares version 1.32.3 - July 24 2024

This is a bugfix release.

Changes:
* Prevent complex recursion during query requeuing and connection cleanup for
stability. [e8b32b8](https://github.com/c-ares/c-ares/commit/e8b32b8)
* Better propagate error codes on requeue situations.
[a9bc0a2](https://github.com/c-ares/c-ares/commit/a9bc0a2)
* Try to prevent SIGPIPE from being generated and delivered to integrations.
[de01baa](https://github.com/c-ares/c-ares/commit/de01baa)

Bugfixes:
* Missing manpage for `ares_dns_record_set_id()`
[aa462b3](https://github.com/c-ares/c-ares/commit/aa462b3)
* Memory leak in `ares__hosts_entry_to_hostent()` due to allocation strategy.
[PR #824](https://github.com/c-ares/c-ares/pull/824)
* UDP write failure detected via ICMP unreachable should trigger faster
failover. [PR #821](https://github.com/c-ares/c-ares/pull/821)
* Fix pycares test case regression due to wrong error code being returned.
Regression from 1.31.0. [PR #820](https://github.com/c-ares/c-ares/pull/820)
* Fix possible Windows crash during `ares_destroy()` when using event threads.
[5609bd4](https://github.com/c-ares/c-ares/commit/5609bd4)
* `ARES_OPT_MAXTIMEOUTMS` wasn't being honored in all cases.
[a649c60](https://github.com/c-ares/c-ares/commit/a649c60)

## c-ares version 1.32.2 - July 15 2024

This is a bugfix release.
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/aminclude_static.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Mon Jul 15 09:00:09 EDT 2024
# from AX_AM_MACROS_STATIC on Wed Jul 24 05:40:58 EDT 2024


# Code coverage
Expand Down
22 changes: 11 additions & 11 deletions deps/cares/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for c-ares 1.32.2.
# Generated by GNU Autoconf 2.72 for c-ares 1.32.3.
#
# Report bugs to <c-ares mailing list: http://lists.haxx.se/listinfo/c-ares>.
#
Expand Down Expand Up @@ -614,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='c-ares'
PACKAGE_TARNAME='c-ares'
PACKAGE_VERSION='1.32.2'
PACKAGE_STRING='c-ares 1.32.2'
PACKAGE_VERSION='1.32.3'
PACKAGE_STRING='c-ares 1.32.3'
PACKAGE_BUGREPORT='c-ares mailing list: http://lists.haxx.se/listinfo/c-ares'
PACKAGE_URL=''

Expand Down Expand Up @@ -1415,7 +1415,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
'configure' configures c-ares 1.32.2 to adapt to many kinds of systems.
'configure' configures c-ares 1.32.3 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1486,7 +1486,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of c-ares 1.32.2:";;
short | recursive ) echo "Configuration of c-ares 1.32.3:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1623,7 +1623,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
c-ares configure 1.32.2
c-ares configure 1.32.3
generated by GNU Autoconf 2.72

Copyright (C) 2023 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2267,7 +2267,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by c-ares $as_me 1.32.2, which was
It was created by c-ares $as_me 1.32.3, which was
generated by GNU Autoconf 2.72. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -3259,7 +3259,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu



CARES_VERSION_INFO="19:2:17"
CARES_VERSION_INFO="19:3:17"



Expand Down Expand Up @@ -5999,7 +5999,7 @@ fi

# Define the identity of the package.
PACKAGE='c-ares'
VERSION='1.32.2'
VERSION='1.32.3'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -26339,7 +26339,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by c-ares $as_me 1.32.2, which was
This file was extended by c-ares $as_me 1.32.3, which was
generated by GNU Autoconf 2.72. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -26407,7 +26407,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
c-ares config.status 1.32.2
c-ares config.status 1.32.3
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

Expand Down
4 changes: 2 additions & 2 deletions deps/cares/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ dnl Copyright (C) The c-ares project and its contributors
dnl SPDX-License-Identifier: MIT
AC_PREREQ([2.69])

AC_INIT([c-ares], [1.32.2],
AC_INIT([c-ares], [1.32.3],
[c-ares mailing list: http://lists.haxx.se/listinfo/c-ares])

CARES_VERSION_INFO="19:2:17"
CARES_VERSION_INFO="19:3:17"
dnl This flag accepts an argument of the form current[:revision[:age]]. So,
dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
dnl 1.
Expand Down
1 change: 1 addition & 0 deletions deps/cares/docs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ MANPAGES = ares_cancel.3 \
ares_dns_record_rr_del.3 \
ares_dns_record_rr_get.3 \
ares_dns_record_rr_get_const.3 \
ares_dns_record_set_id.3 \
ares_dns_rec_type_fromstr.3 \
ares_dns_rec_type_tostr.3 \
ares_dns_rec_type_t.3 \
Expand Down
1 change: 1 addition & 0 deletions deps/cares/docs/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ MANPAGES = ares_cancel.3 \
ares_dns_record_rr_del.3 \
ares_dns_record_rr_get.3 \
ares_dns_record_rr_get_const.3 \
ares_dns_record_set_id.3 \
ares_dns_rec_type_fromstr.3 \
ares_dns_rec_type_tostr.3 \
ares_dns_rec_type_t.3 \
Expand Down
23 changes: 17 additions & 6 deletions deps/cares/docs/ares_dns_record.3
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ares_dns_record_t *ares_dns_record_duplicate(const ares_dns_record_t *dnsrec);

unsigned short ares_dns_record_get_id(const ares_dns_record_t *dnsrec);

ares_bool_t ares_dns_record_set_id(ares_dns_record_t *dnsrec,
unsigned short id);

unsigned short ares_dns_record_get_flags(const ares_dns_record_t *dnsrec);

ares_dns_opcode_t ares_dns_record_get_opcode(const ares_dns_record_t *dnsrec);
Expand Down Expand Up @@ -343,6 +346,14 @@ message id from the DNS record provided in the
.IR dnsrec
parameter.

The \fIares_dns_record_set_id(3)\fP function is used to set the DNS
message id in the
.IR id
parameter from the DNS record provided in the
.IR dnsrec
parameter. This id will be overwritten when passing the record to c-ares,
so mostly exists for external purposes.

The \fIares_dns_record_get_flags(3)\fP function is used to retrieve the DNS
message flags from the DNS record provided in the
.IR dnsrec
Expand Down Expand Up @@ -428,12 +439,12 @@ is returned on out of memory,
.B ARES_EFORMERR
is returned on misuse.

\fIares_dns_record_get_id(3)\fP, \fIares_dns_record_get_flags(3)\fP,
\fIares_dns_record_get_opcode(3)\fP, \fIares_dns_record_get_rcode(3)\fP, and
\fIares_dns_record_query_cnt(3)\fP all returned their prescribed datatype
values and in general can't fail except for misuse cases, in which a 0 may
be returned, however 0 can also be a valid return value for most of these
functions.
\fIares_dns_record_get_id(3)\fP, \fIares_dns_record_set_id(3)\fP,
\fIares_dns_record_get_flags(3)\fP, \fIares_dns_record_get_opcode(3)\fP,
\fIares_dns_record_get_rcode(3)\fP, and \fIares_dns_record_query_cnt(3)\fP
all returned their prescribed datatype values and in general can't fail except
for misuse cases, in which a 0 may be returned, however 0 can also be a valid
return value for most of these functions.


.SH AVAILABILITY
Expand Down
3 changes: 3 additions & 0 deletions deps/cares/docs/ares_dns_record_set_id.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.\" Copyright (C) 2023 The c-ares project and its contributors.
.\" SPDX-License-Identifier: MIT
.so man3/ares_dns_record.3
4 changes: 2 additions & 2 deletions deps/cares/include/ares_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@

#define ARES_VERSION_MAJOR 1
#define ARES_VERSION_MINOR 32
#define ARES_VERSION_PATCH 2
#define ARES_VERSION_PATCH 3
#define ARES_VERSION \
((ARES_VERSION_MAJOR << 16) | (ARES_VERSION_MINOR << 8) | \
(ARES_VERSION_PATCH))
#define ARES_VERSION_STR "1.32.2"
#define ARES_VERSION_STR "1.32.3"

#define CARES_HAVE_ARES_LIBRARY_INIT 1
#define CARES_HAVE_ARES_LIBRARY_CLEANUP 1
Expand Down
2 changes: 1 addition & 1 deletion deps/cares/src/lib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@SET_MAKE@

# aminclude_static.am generated automatically by Autoconf
# from AX_AM_MACROS_STATIC on Mon Jul 15 09:00:09 EDT 2024
# from AX_AM_MACROS_STATIC on Wed Jul 24 05:40:58 EDT 2024

# Copyright (C) The c-ares project and its contributors
# SPDX-License-Identifier: MIT
Expand Down
92 changes: 56 additions & 36 deletions deps/cares/src/lib/ares__close_sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,21 @@
#include "ares_private.h"
#include <assert.h>

static void ares__requeue_queries(struct server_connection *conn)
static void ares__requeue_queries(struct server_connection *conn,
ares_status_t requeue_status)
{
struct query *query;
ares_timeval_t now;

ares__tvnow(&now);

while ((query = ares__llist_first_val(conn->queries_to_conn)) != NULL) {
ares__requeue_query(query, &now);
ares__requeue_query(query, &now, requeue_status);
}
}

void ares__close_connection(struct server_connection *conn)
void ares__close_connection(struct server_connection *conn,
ares_status_t requeue_status)
{
struct server_state *server = conn->server;
ares_channel_t *channel = server->channel;
Expand All @@ -58,7 +60,7 @@ void ares__close_connection(struct server_connection *conn)
}

/* Requeue queries to other connections */
ares__requeue_queries(conn);
ares__requeue_queries(conn, requeue_status);

ares__llist_destroy(conn->queries_to_conn);

Expand All @@ -74,45 +76,63 @@ void ares__close_sockets(struct server_state *server)

while ((node = ares__llist_node_first(server->connections)) != NULL) {
struct server_connection *conn = ares__llist_node_val(node);
ares__close_connection(conn);
ares__close_connection(conn, ARES_SUCCESS);
}
}

void ares__check_cleanup_conn(const ares_channel_t *channel,
struct server_connection *conn)
void ares__check_cleanup_conns(const ares_channel_t *channel)
{
ares_bool_t do_cleanup = ARES_FALSE;
ares__slist_node_t *snode;

if (channel == NULL || conn == NULL) {
if (channel == NULL) {
return; /* LCOV_EXCL_LINE: DefensiveCoding */
}

if (ares__llist_len(conn->queries_to_conn)) {
return;
/* Iterate across each server */
for (snode = ares__slist_node_first(channel->servers); snode != NULL;
snode = ares__slist_node_next(snode)) {

struct server_state *server = ares__slist_node_val(snode);
ares__llist_node_t *cnode;

/* Iterate across each connection */
cnode = ares__llist_node_first(server->connections);
while (cnode != NULL) {
ares__llist_node_t *next = ares__llist_node_next(cnode);
struct server_connection *conn = ares__llist_node_val(cnode);
ares_bool_t do_cleanup = ARES_FALSE;
cnode = next;

/* Has connections, not eligible */
if (ares__llist_len(conn->queries_to_conn)) {
continue;
}

/* If we are configured not to stay open, close it out */
if (!(channel->flags & ARES_FLAG_STAYOPEN)) {
do_cleanup = ARES_TRUE;
}

/* If the associated server has failures, close it out. Resetting the
* connection (and specifically the source port number) can help resolve
* situations where packets are being dropped.
*/
if (conn->server->consec_failures > 0) {
do_cleanup = ARES_TRUE;
}

/* If the udp connection hit its max queries, always close it */
if (!conn->is_tcp && channel->udp_max_queries > 0 &&
conn->total_queries >= channel->udp_max_queries) {
do_cleanup = ARES_TRUE;
}

if (!do_cleanup) {
continue;
}

/* Clean it up */
ares__close_connection(conn, ARES_SUCCESS);
}
}

/* If we are configured not to stay open, close it out */
if (!(channel->flags & ARES_FLAG_STAYOPEN)) {
do_cleanup = ARES_TRUE;
}

/* If the associated server has failures, close it out. Resetting the
* connection (and specifically the source port number) can help resolve
* situations where packets are being dropped.
*/
if (conn->server->consec_failures > 0) {
do_cleanup = ARES_TRUE;
}

/* If the udp connection hit its max queries, always close it */
if (!conn->is_tcp && channel->udp_max_queries > 0 &&
conn->total_queries >= channel->udp_max_queries) {
do_cleanup = ARES_TRUE;
}

if (!do_cleanup) {
return;
}

ares__close_connection(conn);
}
Loading

0 comments on commit 496975e

Please sign in to comment.