Skip to content

Commit 96e4794

Browse files
nodejs-github-botmarco-ippolito
authored andcommitted
deps: update c-ares to v1.32.3
PR-URL: #54020 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 05d6bf6 commit 96e4794

24 files changed

+297
-263
lines changed

deps/cares/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
1212
INCLUDE (CheckStructHasMember)
1313
INCLUDE (CheckLibraryExists)
1414

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

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

3535

3636
OPTION (CARES_STATIC "Build as a static library" OFF)

deps/cares/RELEASE-NOTES.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## c-ares version 1.32.3 - July 24 2024
2+
3+
This is a bugfix release.
4+
5+
Changes:
6+
* Prevent complex recursion during query requeuing and connection cleanup for
7+
stability. [e8b32b8](https://github.com/c-ares/c-ares/commit/e8b32b8)
8+
* Better propagate error codes on requeue situations.
9+
[a9bc0a2](https://github.com/c-ares/c-ares/commit/a9bc0a2)
10+
* Try to prevent SIGPIPE from being generated and delivered to integrations.
11+
[de01baa](https://github.com/c-ares/c-ares/commit/de01baa)
12+
13+
Bugfixes:
14+
* Missing manpage for `ares_dns_record_set_id()`
15+
[aa462b3](https://github.com/c-ares/c-ares/commit/aa462b3)
16+
* Memory leak in `ares__hosts_entry_to_hostent()` due to allocation strategy.
17+
[PR #824](https://github.com/c-ares/c-ares/pull/824)
18+
* UDP write failure detected via ICMP unreachable should trigger faster
19+
failover. [PR #821](https://github.com/c-ares/c-ares/pull/821)
20+
* Fix pycares test case regression due to wrong error code being returned.
21+
Regression from 1.31.0. [PR #820](https://github.com/c-ares/c-ares/pull/820)
22+
* Fix possible Windows crash during `ares_destroy()` when using event threads.
23+
[5609bd4](https://github.com/c-ares/c-ares/commit/5609bd4)
24+
* `ARES_OPT_MAXTIMEOUTMS` wasn't being honored in all cases.
25+
[a649c60](https://github.com/c-ares/c-ares/commit/a649c60)
26+
127
## c-ares version 1.32.2 - July 15 2024
228

329
This is a bugfix release.

deps/cares/aminclude_static.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

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

55

66
# Code coverage

deps/cares/configure

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.72 for c-ares 1.32.2.
3+
# Generated by GNU Autoconf 2.72 for c-ares 1.32.3.
44
#
55
# Report bugs to <c-ares mailing list: http://lists.haxx.se/listinfo/c-ares>.
66
#
@@ -614,8 +614,8 @@ MAKEFLAGS=
614614
# Identity of this package.
615615
PACKAGE_NAME='c-ares'
616616
PACKAGE_TARNAME='c-ares'
617-
PACKAGE_VERSION='1.32.2'
618-
PACKAGE_STRING='c-ares 1.32.2'
617+
PACKAGE_VERSION='1.32.3'
618+
PACKAGE_STRING='c-ares 1.32.3'
619619
PACKAGE_BUGREPORT='c-ares mailing list: http://lists.haxx.se/listinfo/c-ares'
620620
PACKAGE_URL=''
621621

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

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

@@ -1486,7 +1486,7 @@ fi
14861486

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

@@ -1623,7 +1623,7 @@ fi
16231623
test -n "$ac_init_help" && exit $ac_status
16241624
if $ac_init_version; then
16251625
cat <<\_ACEOF
1626-
c-ares configure 1.32.2
1626+
c-ares configure 1.32.3
16271627
generated by GNU Autoconf 2.72
16281628

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

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

22732273
$ $0$ac_configure_args_raw
@@ -3259,7 +3259,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
32593259

32603260

32613261

3262-
CARES_VERSION_INFO="19:2:17"
3262+
CARES_VERSION_INFO="19:3:17"
32633263

32643264

32653265

@@ -5999,7 +5999,7 @@ fi
59995999

60006000
# Define the identity of the package.
60016001
PACKAGE='c-ares'
6002-
VERSION='1.32.2'
6002+
VERSION='1.32.3'
60036003

60046004

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

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

deps/cares/configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ dnl Copyright (C) The c-ares project and its contributors
22
dnl SPDX-License-Identifier: MIT
33
AC_PREREQ([2.69])
44

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

8-
CARES_VERSION_INFO="19:2:17"
8+
CARES_VERSION_INFO="19:3:17"
99
dnl This flag accepts an argument of the form current[:revision[:age]]. So,
1010
dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
1111
dnl 1.

deps/cares/docs/Makefile.in

+1
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ MANPAGES = ares_cancel.3 \
374374
ares_dns_record_rr_del.3 \
375375
ares_dns_record_rr_get.3 \
376376
ares_dns_record_rr_get_const.3 \
377+
ares_dns_record_set_id.3 \
377378
ares_dns_rec_type_fromstr.3 \
378379
ares_dns_rec_type_tostr.3 \
379380
ares_dns_rec_type_t.3 \

deps/cares/docs/Makefile.inc

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ MANPAGES = ares_cancel.3 \
3636
ares_dns_record_rr_del.3 \
3737
ares_dns_record_rr_get.3 \
3838
ares_dns_record_rr_get_const.3 \
39+
ares_dns_record_set_id.3 \
3940
ares_dns_rec_type_fromstr.3 \
4041
ares_dns_rec_type_tostr.3 \
4142
ares_dns_rec_type_t.3 \

deps/cares/docs/ares_dns_record.3

+17-6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ ares_dns_record_t *ares_dns_record_duplicate(const ares_dns_record_t *dnsrec);
3232

3333
unsigned short ares_dns_record_get_id(const ares_dns_record_t *dnsrec);
3434

35+
ares_bool_t ares_dns_record_set_id(ares_dns_record_t *dnsrec,
36+
unsigned short id);
37+
3538
unsigned short ares_dns_record_get_flags(const ares_dns_record_t *dnsrec);
3639

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

349+
The \fIares_dns_record_set_id(3)\fP function is used to set the DNS
350+
message id in the
351+
.IR id
352+
parameter from the DNS record provided in the
353+
.IR dnsrec
354+
parameter. This id will be overwritten when passing the record to c-ares,
355+
so mostly exists for external purposes.
356+
346357
The \fIares_dns_record_get_flags(3)\fP function is used to retrieve the DNS
347358
message flags from the DNS record provided in the
348359
.IR dnsrec
@@ -428,12 +439,12 @@ is returned on out of memory,
428439
.B ARES_EFORMERR
429440
is returned on misuse.
430441

431-
\fIares_dns_record_get_id(3)\fP, \fIares_dns_record_get_flags(3)\fP,
432-
\fIares_dns_record_get_opcode(3)\fP, \fIares_dns_record_get_rcode(3)\fP, and
433-
\fIares_dns_record_query_cnt(3)\fP all returned their prescribed datatype
434-
values and in general can't fail except for misuse cases, in which a 0 may
435-
be returned, however 0 can also be a valid return value for most of these
436-
functions.
442+
\fIares_dns_record_get_id(3)\fP, \fIares_dns_record_set_id(3)\fP,
443+
\fIares_dns_record_get_flags(3)\fP, \fIares_dns_record_get_opcode(3)\fP,
444+
\fIares_dns_record_get_rcode(3)\fP, and \fIares_dns_record_query_cnt(3)\fP
445+
all returned their prescribed datatype values and in general can't fail except
446+
for misuse cases, in which a 0 may be returned, however 0 can also be a valid
447+
return value for most of these functions.
437448

438449

439450
.SH AVAILABILITY
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.\" Copyright (C) 2023 The c-ares project and its contributors.
2+
.\" SPDX-License-Identifier: MIT
3+
.so man3/ares_dns_record.3

deps/cares/include/ares_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232

3333
#define ARES_VERSION_MAJOR 1
3434
#define ARES_VERSION_MINOR 32
35-
#define ARES_VERSION_PATCH 2
35+
#define ARES_VERSION_PATCH 3
3636
#define ARES_VERSION \
3737
((ARES_VERSION_MAJOR << 16) | (ARES_VERSION_MINOR << 8) | \
3838
(ARES_VERSION_PATCH))
39-
#define ARES_VERSION_STR "1.32.2"
39+
#define ARES_VERSION_STR "1.32.3"
4040

4141
#define CARES_HAVE_ARES_LIBRARY_INIT 1
4242
#define CARES_HAVE_ARES_LIBRARY_CLEANUP 1

deps/cares/src/lib/Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
@SET_MAKE@
1616

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

2020
# Copyright (C) The c-ares project and its contributors
2121
# SPDX-License-Identifier: MIT

deps/cares/src/lib/ares__close_sockets.c

+56-36
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,21 @@
2828
#include "ares_private.h"
2929
#include <assert.h>
3030

31-
static void ares__requeue_queries(struct server_connection *conn)
31+
static void ares__requeue_queries(struct server_connection *conn,
32+
ares_status_t requeue_status)
3233
{
3334
struct query *query;
3435
ares_timeval_t now;
3536

3637
ares__tvnow(&now);
3738

3839
while ((query = ares__llist_first_val(conn->queries_to_conn)) != NULL) {
39-
ares__requeue_query(query, &now);
40+
ares__requeue_query(query, &now, requeue_status);
4041
}
4142
}
4243

43-
void ares__close_connection(struct server_connection *conn)
44+
void ares__close_connection(struct server_connection *conn,
45+
ares_status_t requeue_status)
4446
{
4547
struct server_state *server = conn->server;
4648
ares_channel_t *channel = server->channel;
@@ -58,7 +60,7 @@ void ares__close_connection(struct server_connection *conn)
5860
}
5961

6062
/* Requeue queries to other connections */
61-
ares__requeue_queries(conn);
63+
ares__requeue_queries(conn, requeue_status);
6264

6365
ares__llist_destroy(conn->queries_to_conn);
6466

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

7577
while ((node = ares__llist_node_first(server->connections)) != NULL) {
7678
struct server_connection *conn = ares__llist_node_val(node);
77-
ares__close_connection(conn);
79+
ares__close_connection(conn, ARES_SUCCESS);
7880
}
7981
}
8082

81-
void ares__check_cleanup_conn(const ares_channel_t *channel,
82-
struct server_connection *conn)
83+
void ares__check_cleanup_conns(const ares_channel_t *channel)
8384
{
84-
ares_bool_t do_cleanup = ARES_FALSE;
85+
ares__slist_node_t *snode;
8586

86-
if (channel == NULL || conn == NULL) {
87+
if (channel == NULL) {
8788
return; /* LCOV_EXCL_LINE: DefensiveCoding */
8889
}
8990

90-
if (ares__llist_len(conn->queries_to_conn)) {
91-
return;
91+
/* Iterate across each server */
92+
for (snode = ares__slist_node_first(channel->servers); snode != NULL;
93+
snode = ares__slist_node_next(snode)) {
94+
95+
struct server_state *server = ares__slist_node_val(snode);
96+
ares__llist_node_t *cnode;
97+
98+
/* Iterate across each connection */
99+
cnode = ares__llist_node_first(server->connections);
100+
while (cnode != NULL) {
101+
ares__llist_node_t *next = ares__llist_node_next(cnode);
102+
struct server_connection *conn = ares__llist_node_val(cnode);
103+
ares_bool_t do_cleanup = ARES_FALSE;
104+
cnode = next;
105+
106+
/* Has connections, not eligible */
107+
if (ares__llist_len(conn->queries_to_conn)) {
108+
continue;
109+
}
110+
111+
/* If we are configured not to stay open, close it out */
112+
if (!(channel->flags & ARES_FLAG_STAYOPEN)) {
113+
do_cleanup = ARES_TRUE;
114+
}
115+
116+
/* If the associated server has failures, close it out. Resetting the
117+
* connection (and specifically the source port number) can help resolve
118+
* situations where packets are being dropped.
119+
*/
120+
if (conn->server->consec_failures > 0) {
121+
do_cleanup = ARES_TRUE;
122+
}
123+
124+
/* If the udp connection hit its max queries, always close it */
125+
if (!conn->is_tcp && channel->udp_max_queries > 0 &&
126+
conn->total_queries >= channel->udp_max_queries) {
127+
do_cleanup = ARES_TRUE;
128+
}
129+
130+
if (!do_cleanup) {
131+
continue;
132+
}
133+
134+
/* Clean it up */
135+
ares__close_connection(conn, ARES_SUCCESS);
136+
}
92137
}
93-
94-
/* If we are configured not to stay open, close it out */
95-
if (!(channel->flags & ARES_FLAG_STAYOPEN)) {
96-
do_cleanup = ARES_TRUE;
97-
}
98-
99-
/* If the associated server has failures, close it out. Resetting the
100-
* connection (and specifically the source port number) can help resolve
101-
* situations where packets are being dropped.
102-
*/
103-
if (conn->server->consec_failures > 0) {
104-
do_cleanup = ARES_TRUE;
105-
}
106-
107-
/* If the udp connection hit its max queries, always close it */
108-
if (!conn->is_tcp && channel->udp_max_queries > 0 &&
109-
conn->total_queries >= channel->udp_max_queries) {
110-
do_cleanup = ARES_TRUE;
111-
}
112-
113-
if (!do_cleanup) {
114-
return;
115-
}
116-
117-
ares__close_connection(conn);
118138
}

0 commit comments

Comments
 (0)