mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-08 23:44:00 +03:00
curl 2026-01-07 (2eebc58c)
Code extracted from:
https://github.com/curl/curl.git
at commit 2eebc58c4b8d68c98c8344381a9f6df4cca838fd (curl-8_18_0).
This commit is contained in:
1 parent
e28c33c159
commit
7bd7b7fa2e
387 files changed
+15080
-17306
No files matched your search
+10
-17
@@ -21,23 +21,17 @@
|
||||
* SPDX-License-Identifier: curl
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "curl_setup.h"
|
||||
|
||||
#ifdef USE_HTTPSRR
|
||||
|
||||
#include "urldata.h"
|
||||
#include "curl_addrinfo.h"
|
||||
#include "httpsrr.h"
|
||||
#include "connect.h"
|
||||
#include "sendf.h"
|
||||
#include "curl_trc.h"
|
||||
#include "strdup.h"
|
||||
|
||||
/* The last 2 #include files should be in this order */
|
||||
#include "curl_memory.h"
|
||||
#include "memdebug.h"
|
||||
|
||||
static CURLcode httpsrr_decode_alpn(const char *cp, size_t len,
|
||||
static CURLcode httpsrr_decode_alpn(const uint8_t *cp, size_t len,
|
||||
unsigned char *alpns)
|
||||
{
|
||||
/*
|
||||
@@ -49,7 +43,7 @@ static CURLcode httpsrr_decode_alpn(const char *cp, size_t len,
|
||||
int idnum = 0;
|
||||
|
||||
while(len > 0) {
|
||||
size_t tlen = (size_t) *cp++;
|
||||
size_t tlen = *cp++;
|
||||
enum alpnid id;
|
||||
len--;
|
||||
if(tlen > len)
|
||||
@@ -84,7 +78,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data,
|
||||
CURL_TRC_DNS(data, "HTTPS RR MANDATORY left to implement");
|
||||
break;
|
||||
case HTTPS_RR_CODE_ALPN: /* str_list */
|
||||
result = httpsrr_decode_alpn((const char *)val, vlen, hi->alpns);
|
||||
result = httpsrr_decode_alpn(val, vlen, hi->alpns);
|
||||
CURL_TRC_DNS(data, "HTTPS RR ALPN: %u %u %u %u",
|
||||
hi->alpns[0], hi->alpns[1], hi->alpns[2], hi->alpns[3]);
|
||||
break;
|
||||
@@ -97,7 +91,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data,
|
||||
case HTTPS_RR_CODE_IPV4: /* addr4 list */
|
||||
if(!vlen || (vlen & 3)) /* the size must be 4-byte aligned */
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
free(hi->ipv4hints);
|
||||
curlx_free(hi->ipv4hints);
|
||||
hi->ipv4hints = Curl_memdup(val, vlen);
|
||||
if(!hi->ipv4hints)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
@@ -107,7 +101,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data,
|
||||
case HTTPS_RR_CODE_ECH:
|
||||
if(!vlen)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
free(hi->echconfiglist);
|
||||
curlx_free(hi->echconfiglist);
|
||||
hi->echconfiglist = Curl_memdup(val, vlen);
|
||||
if(!hi->echconfiglist)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
@@ -117,7 +111,7 @@ CURLcode Curl_httpsrr_set(struct Curl_easy *data,
|
||||
case HTTPS_RR_CODE_IPV6: /* addr6 list */
|
||||
if(!vlen || (vlen & 15)) /* the size must be 16-byte aligned */
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
free(hi->ipv6hints);
|
||||
curlx_free(hi->ipv6hints);
|
||||
hi->ipv6hints = Curl_memdup(val, vlen);
|
||||
if(!hi->ipv6hints)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
@@ -155,7 +149,6 @@ void Curl_httpsrr_cleanup(struct Curl_https_rrinfo *rrinfo)
|
||||
Curl_safefree(rrinfo->rrname);
|
||||
}
|
||||
|
||||
|
||||
#ifdef USE_ARES
|
||||
|
||||
static CURLcode httpsrr_opt(struct Curl_easy *data,
|
||||
@@ -167,7 +160,7 @@ static CURLcode httpsrr_opt(struct Curl_easy *data,
|
||||
unsigned short code;
|
||||
size_t len = 0;
|
||||
|
||||
code = ares_dns_rr_get_opt(rr, key, idx, &val, &len);
|
||||
code = ares_dns_rr_get_opt(rr, key, idx, &val, &len);
|
||||
return Curl_httpsrr_set(data, hinfo, code, val, len);
|
||||
}
|
||||
|
||||
@@ -189,8 +182,8 @@ CURLcode Curl_httpsrr_from_ares(struct Curl_easy *data,
|
||||
is in ServiceMode */
|
||||
target = ares_dns_rr_get_str(rr, ARES_RR_HTTPS_TARGET);
|
||||
if(target && target[0]) {
|
||||
free(hinfo->target);
|
||||
hinfo->target = strdup(target);
|
||||
curlx_free(hinfo->target);
|
||||
hinfo->target = curlx_strdup(target);
|
||||
if(!hinfo->target) {
|
||||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto out;
|
||||
|
||||
Reference in new issue
Block a user