Skip to content

Update curl from 7.85.0 to 7.86.0 #2835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,575 changes: 5,828 additions & 4,747 deletions vendor/curl/CHANGES

Large diffs are not rendered by default.

764 changes: 404 additions & 360 deletions vendor/curl/RELEASE-NOTES

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions vendor/curl/include/curl/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,8 @@ enum curl_khstat {
CURLKHSTAT_FINE_ADD_TO_FILE,
CURLKHSTAT_FINE,
CURLKHSTAT_REJECT, /* reject the connection, return an error */
CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
this causes a CURLE_DEFER error but otherwise the
CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now.
Causes a CURLE_PEER_FAILED_VERIFICATION error but the
connection will be left intact etc */
CURLKHSTAT_FINE_REPLACE, /* accept and replace the wrong key*/
CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
Expand Down Expand Up @@ -2154,6 +2154,9 @@ typedef enum {
/* specify which protocols that libcurl is allowed to follow directs to */
CURLOPT(CURLOPT_REDIR_PROTOCOLS_STR, CURLOPTTYPE_STRINGPOINT, 319),

/* websockets options */
CURLOPT(CURLOPT_WS_OPTIONS, CURLOPTTYPE_LONG, 320),

CURLOPT_LASTENTRY /* the last unused */
} CURLoption;

Expand Down Expand Up @@ -3109,6 +3112,7 @@ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
#include "urlapi.h"
#include "options.h"
#include "header.h"
#include "websockets.h"

/* the typechecker doesn't work in C++ (yet) */
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
Expand Down
8 changes: 4 additions & 4 deletions vendor/curl/include/curl/curlver.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@

/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.85.0"
#define LIBCURL_VERSION "7.86.0"

/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 85
#define LIBCURL_VERSION_MINOR 86
#define LIBCURL_VERSION_PATCH 0

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

/*
* This is the date and time when the full source package was created. The
Expand All @@ -70,7 +70,7 @@
*
* "2007-11-23"
*/
#define LIBCURL_TIMESTAMP "2022-08-31"
#define LIBCURL_TIMESTAMP "2022-10-26"

#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
#define CURL_AT_LEAST_VERSION(x,y,z) \
Expand Down
8 changes: 8 additions & 0 deletions vendor/curl/include/curl/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
*
***************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

struct curl_header {
char *name; /* this might not use the same case */
char *value;
Expand Down Expand Up @@ -63,4 +67,8 @@ CURL_EXTERN struct curl_header *curl_easy_nextheader(CURL *easy,
int request,
struct curl_header *prev);

#ifdef __cplusplus
} /* end of extern "C" */
#endif

#endif /* CURLINC_HEADER_H */
2 changes: 1 addition & 1 deletion vendor/curl/include/curl/multi.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct curl_waitfd {
/*
* Name: curl_multi_init()
*
* Desc: inititalize multi-style curl usage
* Desc: initialize multi-style curl usage
*
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/curl/include/curl/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef enum {
CURLOT_VALUES, /* (a defined set or bitmask) */
CURLOT_OFF_T, /* curl_off_t (a range of values) */
CURLOT_OBJECT, /* pointer (void *) */
CURLOT_STRING, /* (char * to zero terminated buffer) */
CURLOT_STRING, /* (char * to null-terminated buffer) */
CURLOT_SLIST, /* (struct curl_slist *) */
CURLOT_CBPTR, /* (void * passed as-is to a callback) */
CURLOT_BLOB, /* blob (struct curl_blob *) */
Expand Down
83 changes: 83 additions & 0 deletions vendor/curl/include/curl/websockets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#ifndef CURLINC_WEBSOCKETS_H
#define CURLINC_WEBSOCKETS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at https://curl.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
* SPDX-License-Identifier: curl
*
***************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

struct curl_ws_frame {
int age; /* zero */
int flags; /* See the CURLWS_* defines */
curl_off_t offset; /* the offset of this data into the frame */
curl_off_t bytesleft; /* number of pending bytes left of the payload */
};

/* flag bits */
#define CURLWS_TEXT (1<<0)
#define CURLWS_BINARY (1<<1)
#define CURLWS_CONT (1<<2)
#define CURLWS_CLOSE (1<<3)
#define CURLWS_PING (1<<4)
#define CURLWS_OFFSET (1<<5)

/*
* NAME curl_ws_recv()
*
* DESCRIPTION
*
* Receives data from the websocket connection. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
size_t *recv,
struct curl_ws_frame **metap);

/* sendflags for curl_ws_send() */
#define CURLWS_PONG (1<<6)

/*
* NAME curl_easy_send()
*
* DESCRIPTION
*
* Sends data over the websocket connection. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
size_t buflen, size_t *sent,
curl_off_t framesize,
unsigned int sendflags);

/* bits for the CURLOPT_WS_OPTIONS bitmask: */
#define CURLWS_RAW_MODE (1<<0)

CURL_EXTERN struct curl_ws_frame *curl_ws_meta(CURL *curl);

#ifdef __cplusplus
}
#endif

#endif /* CURLINC_WEBSOCKETS_H */
33 changes: 14 additions & 19 deletions vendor/curl/lib/altsvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@
#define MAX_ALTSVC_ALPNLENSTR "10"
#define MAX_ALTSVC_ALPNLEN 10

#if defined(USE_QUICHE) && !defined(UNITTESTS)
#define H3VERSION "h3-29"
#elif defined(USE_NGTCP2) && !defined(UNITTESTS)
#define H3VERSION "h3-29"
#elif defined(USE_MSH3) && !defined(UNITTESTS)
#define H3VERSION "h3-29"
#else
#define H3VERSION "h3"
#endif

static enum alpnid alpn2alpnid(char *name)
{
Expand Down Expand Up @@ -470,6 +462,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
struct altsvc *as;
unsigned short dstport = srcport; /* the same by default */
CURLcode result = getalnum(&p, alpnbuf, sizeof(alpnbuf));
size_t entries = 0;
#ifdef CURL_DISABLE_VERBOSE_STRINGS
(void)data;
#endif
Expand All @@ -480,11 +473,10 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,

DEBUGASSERT(asi);

/* Flush all cached alternatives for this source origin, if any */
altsvc_flush(asi, srcalpnid, srchost, srcport);

/* "clear" is a magic keyword */
if(strcasecompare(alpnbuf, "clear")) {
/* Flush cached alternatives for this source origin */
altsvc_flush(asi, srcalpnid, srchost, srcport);
return CURLE_OK;
}

Expand All @@ -502,6 +494,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
bool quoted = FALSE;
time_t maxage = 24 * 3600; /* default is 24 hours */
bool persist = FALSE;
bool valid = TRUE;
p++;
if(*p != ':') {
/* host name starts here */
Expand All @@ -511,7 +504,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
len = p - hostp;
if(!len || (len >= MAX_ALTSVC_HOSTLEN)) {
infof(data, "Excessive alt-svc host name, ignoring.");
dstalpnid = ALPN_none;
valid = FALSE;
}
else {
memcpy(namebuf, hostp, len);
Expand All @@ -528,10 +521,11 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
unsigned long port = strtoul(++p, &end_ptr, 10);
if(port > USHRT_MAX || end_ptr == p || *end_ptr != '\"') {
infof(data, "Unknown alt-svc port number, ignoring.");
dstalpnid = ALPN_none;
valid = FALSE;
}
else
dstport = curlx_ultous(port);
p = end_ptr;
dstport = curlx_ultous(port);
}
if(*p++ != '\"')
break;
Expand Down Expand Up @@ -583,7 +577,12 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
persist = TRUE;
}
}
if(dstalpnid) {
if(dstalpnid && valid) {
if(!entries++)
/* Flush cached alternatives for this source origin, if any - when
this is the first entry of the line. */
altsvc_flush(asi, srcalpnid, srchost, srcport);

as = altsvc_createid(srchost, dsthost,
srcalpnid, dstalpnid,
srcport, dstport);
Expand All @@ -597,10 +596,6 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
Curl_alpnid2str(dstalpnid));
}
}
else {
infof(data, "Unknown alt-svc protocol \"%s\", skipping.",
alpnbuf);
}
}
else
break;
Expand Down
2 changes: 2 additions & 0 deletions vendor/curl/lib/amigaos.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

#ifdef __AMIGA__

#include <curl/curl.h>

#include "hostip.h"
#include "amigaos.h"

Expand Down
10 changes: 7 additions & 3 deletions vendor/curl/lib/asyn-ares.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ static void addrinfo_cb(void *arg, int status, int timeouts,
* Curl_resolver_getaddrinfo() - when using ares
*
* Returns name information about the given hostname and port number. If
* successful, the 'hostent' is returned and the forth argument will point to
* successful, the 'hostent' is returned and the fourth argument will point to
* memory we need to free after use. That memory *MUST* be freed with
* Curl_freeaddrinfo(), nothing else.
*/
Expand Down Expand Up @@ -779,13 +779,17 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
int pf = PF_INET;
memset(&hints, 0, sizeof(hints));
#ifdef CURLRES_IPV6
if(Curl_ipv6works(data))
if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
/* The stack seems to be IPv6-enabled */
pf = PF_UNSPEC;
#endif /* CURLRES_IPV6 */
hints.ai_family = pf;
hints.ai_socktype = (data->conn->transport == TRNSPRT_TCP)?
SOCK_STREAM : SOCK_DGRAM;
/* Since the service is a numerical one, set the hint flags
* accordingly to save a call to getservbyname in inside C-Ares
*/
hints.ai_flags = ARES_AI_NUMERICSERV;
msnprintf(service, sizeof(service), "%d", port);
res->num_pending = 1;
ares_getaddrinfo((ares_channel)data->state.async.resolver, hostname,
Expand All @@ -794,7 +798,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
#else

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

Expand Down
2 changes: 1 addition & 1 deletion vendor/curl/lib/asyn-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ struct Curl_addrinfo *Curl_resolver_getaddrinfo(struct Curl_easy *data,
*waitp = 0; /* default to synchronous response */

#ifdef CURLRES_IPV6
if(Curl_ipv6works(data))
if((data->conn->ip_version != CURL_IPRESOLVE_V4) && Curl_ipv6works(data))
/* The stack seems to be IPv6-enabled */
pf = PF_UNSPEC;
#endif /* CURLRES_IPV6 */
Expand Down
2 changes: 1 addition & 1 deletion vendor/curl/lib/asyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ CURLcode Curl_resolver_wait_resolv(struct Curl_easy *data,
* Curl_resolver_getaddrinfo() - when using this resolver
*
* Returns name information about the given hostname and port number. If
* successful, the 'hostent' is returned and the forth argument will point to
* successful, the 'hostent' is returned and the fourth argument will point to
* memory we need to free after use. That memory *MUST* be freed with
* Curl_freeaddrinfo(), nothing else.
*
Expand Down
4 changes: 2 additions & 2 deletions vendor/curl/lib/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
static const char base64[]=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

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

/* Allocate our buffer including room for a zero terminator */
/* Allocate our buffer including room for a null-terminator */
newstr = malloc(rawlen + 1);
if(!newstr)
return CURLE_OUT_OF_MEMORY;
Expand Down
Loading