Skip to content

Commit 44577e8

Browse files
Update curl from 7.85.0 to 7.86.0 (#2835)
* Update curl from 7.85.0 to 7.86.0 * Run configure on macos and linux ./configure --disable-ipv6 --without-quiche --without-nghttp2 --without-nghttp3 --without-ngtcp2 --without-librtmp --without-ca-bundle --without-brotli --without-zstd --with-mbedtls --disable-ldap --disable-manual --disable-alt-svc --disable-hsts --disable-rtsp --without-zlib --disable-ntlm-wb --disable-headers-api
1 parent d8e29be commit 44577e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+10118
-7586
lines changed

vendor/curl/CHANGES

Lines changed: 5828 additions & 4747 deletions
Large diffs are not rendered by default.

vendor/curl/RELEASE-NOTES

Lines changed: 404 additions & 360 deletions
Large diffs are not rendered by default.

vendor/curl/include/curl/curl.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,8 @@ enum curl_khstat {
840840
CURLKHSTAT_FINE_ADD_TO_FILE,
841841
CURLKHSTAT_FINE,
842842
CURLKHSTAT_REJECT, /* reject the connection, return an error */
843-
CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
844-
this causes a CURLE_DEFER error but otherwise the
843+
CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
844+
Causes a CURLE_PEER_FAILED_VERIFICATION error but the
845845
connection will be left intact etc */
846846
CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key*/
847847
CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
@@ -2154,6 +2154,9 @@ typedef enum {
21542154
/* specify which protocols that libcurl is allowed to follow directs to */
21552155
CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),
21562156

2157+
/* websockets options */
2158+
CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),
2159+
21572160
CURLOPT_LASTENTRY /* the last unused */
21582161
} CURLoption;
21592162

@@ -3109,6 +3112,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
31093112
#include "urlapi.h"
31103113
#include "options.h"
31113114
#include "header.h"
3115+
#include "websockets.h"
31123116

31133117
/* the typechecker doesn't work in C++ (yet) */
31143118
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \

vendor/curl/include/curl/curlver.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232

3333
/* This is the version number of the libcurl package from which this header
3434
file origins: */
35-
#define LIBCURL_VERSION "7.85.0"
35+
#define LIBCURL_VERSION "7.86.0"
3636

3737
/* The numeric version number is also available "in parts" by using these
3838
defines: */
3939
#define LIBCURL_VERSION_MAJOR 7
40-
#define LIBCURL_VERSION_MINOR 85
40+
#define LIBCURL_VERSION_MINOR 86
4141
#define LIBCURL_VERSION_PATCH 0
4242

4343
/* This is the numeric version of the libcurl version number, meant for easier
@@ -59,7 +59,7 @@
5959
CURL_VERSION_BITS() macro since curl's own configure script greps for it
6060
and needs it to contain the full number.
6161
*/
62-
#define LIBCURL_VERSION_NUM 0x075500
62+
#define LIBCURL_VERSION_NUM 0x075600
6363

6464
/*
6565
* This is the date and time when the full source package was created. The
@@ -70,7 +70,7 @@
7070
*
7171
* "2007-11-23"
7272
*/
73-
#define LIBCURL_TIMESTAMP "2022-08-31"
73+
#define LIBCURL_TIMESTAMP "2022-10-26"
7474

7575
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
7676
#define CURL_AT_LEAST_VERSION(x,y,z) \

vendor/curl/include/curl/header.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
*
2525
***************************************************************************/
2626

27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
2731
struct curl_header {
2832
char *name; /* this might not use the same case */
2933
char *value;
@@ -63,4 +67,8 @@ CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
6367
int request,
6468
struct curl_header *prev);
6569

70+
#ifdef __cplusplus
71+
} /* end of extern "C" */
72+
#endif
73+
6674
#endif /* CURLINC_HEADER_H */

vendor/curl/include/curl/multi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct curl_waitfd {
124124
/*
125125
* Name: curl_multi_init()
126126
*
127-
* Desc: inititalize multi-style curl usage
127+
* Desc: initialize multi-style curl usage
128128
*
129129
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
130130
*/

vendor/curl/include/curl/options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ typedef enum {
3333
CURLOT_VALUES, /* (a defined set or bitmask) */
3434
CURLOT_OFF_T, /* curl_off_t (a range of values) */
3535
CURLOT_OBJECT, /* pointer (void *) */
36-
CURLOT_STRING, /* (char * to zero terminated buffer) */
36+
CURLOT_STRING, /* (char * to null-terminated buffer) */
3737
CURLOT_SLIST, /* (struct curl_slist *) */
3838
CURLOT_CBPTR, /* (void * passed as-is to a callback) */
3939
CURLOT_BLOB, /* blob (struct curl_blob *) */

vendor/curl/include/curl/websockets.h

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
#ifndef CURLINC_WEBSOCKETS_H
2+
#define CURLINC_WEBSOCKETS_H
3+
/***************************************************************************
4+
* _ _ ____ _
5+
* Project ___| | | | _ \| |
6+
* / __| | | | |_) | |
7+
* | (__| |_| | _ <| |___
8+
* \___|\___/|_| \_\_____|
9+
*
10+
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
11+
*
12+
* This software is licensed as described in the file COPYING, which
13+
* you should have received as part of this distribution. The terms
14+
* are also available at https://curl.se/docs/copyright.html.
15+
*
16+
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
17+
* copies of the Software, and permit persons to whom the Software is
18+
* furnished to do so, under the terms of the COPYING file.
19+
*
20+
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21+
* KIND, either express or implied.
22+
*
23+
* SPDX-License-Identifier: curl
24+
*
25+
***************************************************************************/
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif
30+
31+
struct curl_ws_frame {
32+
int age; /* zero */
33+
int flags; /* See the CURLWS_* defines */
34+
curl_off_t offset; /* the offset of this data into the frame */
35+
curl_off_t bytesleft; /* number of pending bytes left of the payload */
36+
};
37+
38+
/* flag bits */
39+
#define CURLWS_TEXT (1<<0)
40+
#define CURLWS_BINARY (1<<1)
41+
#define CURLWS_CONT (1<<2)
42+
#define CURLWS_CLOSE (1<<3)
43+
#define CURLWS_PING (1<<4)
44+
#define CURLWS_OFFSET (1<<5)
45+
46+
/*
47+
* NAME curl_ws_recv()
48+
*
49+
* DESCRIPTION
50+
*
51+
* Receives data from the websocket connection. Use after successful
52+
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
53+
*/
54+
CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
55+
size_t *recv,
56+
struct curl_ws_frame **metap);
57+
58+
/* sendflags for curl_ws_send() */
59+
#define CURLWS_PONG (1<<6)
60+
61+
/*
62+
* NAME curl_easy_send()
63+
*
64+
* DESCRIPTION
65+
*
66+
* Sends data over the websocket connection. Use after successful
67+
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
68+
*/
69+
CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
70+
size_t buflen, size_t *sent,
71+
curl_off_t framesize,
72+
unsigned int sendflags);
73+
74+
/* bits for the CURLOPT_WS_OPTIONS bitmask: */
75+
#define CURLWS_RAW_MODE (1<<0)
76+
77+
CURL_EXTERN struct curl_ws_frame *curl_ws_meta(CURL *curl);
78+
79+
#ifdef __cplusplus
80+
}
81+
#endif
82+
83+
#endif /* CURLINC_WEBSOCKETS_H */

vendor/curl/lib/altsvc.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,7 @@
5252
#define MAX_ALTSVC_ALPNLENSTR "10"
5353
#define MAX_ALTSVC_ALPNLEN 10
5454

55-
#if defined(USE_QUICHE) && !defined(UNITTESTS)
56-
#define H3VERSION "h3-29"
57-
#elif defined(USE_NGTCP2) && !defined(UNITTESTS)
58-
#define H3VERSION "h3-29"
59-
#elif defined(USE_MSH3) && !defined(UNITTESTS)
60-
#define H3VERSION "h3-29"
61-
#else
6255
#define H3VERSION "h3"
63-
#endif
6456

6557
static enum alpnid alpn2alpnid(char *name)
6658
{
@@ -470,6 +462,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
470462
struct altsvc *as;
471463
unsigned short dstport = srcport; /* the same by default */
472464
CURLcode result = getalnum(&p, alpnbuf, sizeof(alpnbuf));
465+
size_t entries = 0;
473466
#ifdef CURL_DISABLE_VERBOSE_STRINGS
474467
(void)data;
475468
#endif
@@ -480,11 +473,10 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
480473

481474
DEBUGASSERT(asi);
482475

483-
/* Flush all cached alternatives for this source origin, if any */
484-
altsvc_flush(asi, srcalpnid, srchost, srcport);
485-
486476
/* "clear" is a magic keyword */
487477
if(strcasecompare(alpnbuf, "clear")) {
478+
/* Flush cached alternatives for this source origin */
479+
altsvc_flush(asi, srcalpnid, srchost, srcport);
488480
return CURLE_OK;
489481
}
490482

@@ -502,6 +494,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
502494
bool quoted = FALSE;
503495
time_t maxage = 24 * 3600; /* default is 24 hours */
504496
bool persist = FALSE;
497+
bool valid = TRUE;
505498
p++;
506499
if(*p != ':') {
507500
/* host name starts here */
@@ -511,7 +504,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
511504
len = p - hostp;
512505
if(!len || (len >= MAX_ALTSVC_HOSTLEN)) {
513506
infof(data, "Excessive alt-svc host name, ignoring.");
514-
dstalpnid = ALPN_none;
507+
valid = FALSE;
515508
}
516509
else {
517510
memcpy(namebuf, hostp, len);
@@ -528,10 +521,11 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
528521
unsigned long port = strtoul(++p, &end_ptr, 10);
529522
if(port > USHRT_MAX || end_ptr == p || *end_ptr != '\"') {
530523
infof(data, "Unknown alt-svc port number, ignoring.");
531-
dstalpnid = ALPN_none;
524+
valid = FALSE;
532525
}
526+
else
527+
dstport = curlx_ultous(port);
533528
p = end_ptr;
534-
dstport = curlx_ultous(port);
535529
}
536530
if(*p++ != '\"')
537531
break;
@@ -583,7 +577,12 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
583577
persist = TRUE;
584578
}
585579
}
586-
if(dstalpnid) {
580+
if(dstalpnid && valid) {
581+
if(!entries++)
582+
/* Flush cached alternatives for this source origin, if any - when
583+
this is the first entry of the line. */
584+
altsvc_flush(asi, srcalpnid, srchost, srcport);
585+
587586
as = altsvc_createid(srchost, dsthost,
588587
srcalpnid, dstalpnid,
589588
srcport, dstport);
@@ -597,10 +596,6 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
597596
Curl_alpnid2str(dstalpnid));
598597
}
599598
}
600-
else {
601-
infof(data, "Unknown alt-svc protocol \"%s\", skipping.",
602-
alpnbuf);
603-
}
604599
}
605600
else
606601
break;

vendor/curl/lib/amigaos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#ifdef __AMIGA__
2828

29+
#include <curl/curl.h>
30+
2931
#include "hostip.h"
3032
#include "amigaos.h"
3133

vendor/curl/lib/asyn-ares.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static void addrinfo_cb(void *arg, int status, int timeouts,
746746
* Curl_resolver_getaddrinfo() - when using ares
747747
*
748748
* Returns name information about the given hostname and port number. If
749-
* successful, the 'hostent' is returned and the forth argument will point to
749+
* successful, the 'hostent' is returned and the fourth argument will point to
750750
* memory we need to free after use. That memory *MUST* be freed with
751751
* Curl_freeaddrinfo(), nothing else.
752752
*/
@@ -779,13 +779,17 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
779779
int pf = PF_INET;
780780
memset(&hints, 0, sizeof(hints));
781781
#ifdef CURLRES_IPV6
782-
if(Curl_ipv6works(data))
782+
if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
783783
/* The stack seems to be IPv6-enabled */
784784
pf = PF_UNSPEC;
785785
#endif /* CURLRES_IPV6 */
786786
hints.ai_family = pf;
787787
hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)?
788788
SOCK_STREAM : SOCK_DGRAM;
789+
/* Since the service is a numerical one, set the hint flags
790+
* accordingly to save a call to getservbyname in inside C-Ares
791+
*/
792+
hints.ai_flags = ARES_AI_NUMERICSERV;
789793
msnprintf(service, sizeof(service), "%d", port);
790794
res->num_pending = 1;
791795
ares_getaddrinfo((ares_channel)data->state.async.resolver, hostname,
@@ -794,7 +798,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
794798
#else
795799

796800
#ifdef HAVE_CARES_IPV6
797-
if(Curl_ipv6works(data)) {
801+
if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data)) {
798802
/* The stack seems to be IPv6-enabled */
799803
res->num_pending = 2;
800804

vendor/curl/lib/asyn-thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
707707
*waitp = 0; /* default to synchronous response */
708708

709709
#ifdef CURLRES_IPV6
710-
if(Curl_ipv6works(data))
710+
if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
711711
/* The stack seems to be IPv6-enabled */
712712
pf = PF_UNSPEC;
713713
#endif /* CURLRES_IPV6 */

vendor/curl/lib/asyn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ CURLcode Curl_resolver_wait_resolv(struct Curl_easy *data,
148148
* Curl_resolver_getaddrinfo() - when using this resolver
149149
*
150150
* Returns name information about the given hostname and port number. If
151-
* successful, the 'hostent' is returned and the forth argument will point to
151+
* successful, the 'hostent' is returned and the fourth argument will point to
152152
* memory we need to free after use. That memory *MUST* be freed with
153153
* Curl_freeaddrinfo(), nothing else.
154154
*

vendor/curl/lib/base64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
static const char base64[]=
4848
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
4949

50-
/* The Base 64 encoding with an URL and filename safe alphabet, RFC 4648
50+
/* The Base 64 encoding with a URL and filename safe alphabet, RFC 4648
5151
section 5 */
5252
static const char base64url[]=
5353
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
@@ -138,7 +138,7 @@ CURLcode Curl_base64_decode(const char *src,
138138
/* Calculate the size of the decoded string */
139139
rawlen = (numQuantums * 3) - padding;
140140

141-
/* Allocate our buffer including room for a zero terminator */
141+
/* Allocate our buffer including room for a null-terminator */
142142
newstr = malloc(rawlen + 1);
143143
if(!newstr)
144144
return CURLE_OUT_OF_MEMORY;

0 commit comments

Comments
 (0)