-
-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathcurl.patch
More file actions
73 lines (70 loc) · 2.39 KB
/
curl.patch
File metadata and controls
73 lines (70 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
diff --git a/lib/ldap.c b/lib/ldap.c
index 16a8f60e2273..83f100481027 100644
--- a/lib/ldap.c
+++ b/lib/ldap.c
@@ -303,9 +303,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done)
if(ldap_ssl)
server = ldap_sslinit(host, (curl_ldap_num_t)ipquad.remote_port, 1);
else
-#else
- server = ldap_init(host, (curl_ldap_num_t)ipquad.remote_port);
#endif
+ server = ldap_init(host, (curl_ldap_num_t)ipquad.remote_port);
if(!server) {
failf(data, "LDAP: cannot setup connect to %s:%u",
conn->host.dispname, ipquad.remote_port);
diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c
index 91a329e91502..b53173c57839 100644
--- a/lib/curlx/strerr.c
+++ b/lib/curlx/strerr.c
@@ -263,7 +263,7 @@ const char *curlx_strerror(int err, char *buf, size_t buflen)
*buf = '\0';
#ifdef _WIN32
- if((!strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
+ if((strerror_s(buf, buflen, err) || !strcmp(buf, "Unknown error")) &&
#ifdef USE_WINSOCK
!get_winsock_error(err, buf, buflen) &&
#endif
diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c
index 26bd15d834fc..725c5163e060 100644
--- a/lib/vquic/curl_ngtcp2.c
+++ b/lib/vquic/curl_ngtcp2.c
@@ -808,6 +809,27 @@ static int cb_get_new_connection_id(ngtcp2_conn *tconn, ngtcp2_cid *cid,
return 0;
}
+#ifdef NGTCP2_CALLBACKS_V3 /* ngtcp2 v1.22.0+ */
+static int cb_get_new_connection_id2(ngtcp2_conn *tconn, ngtcp2_cid *cid,
+ struct ngtcp2_stateless_reset_token *token, size_t cidlen, void *user_data)
+{
+ CURLcode result;
+ (void)tconn;
+ (void)user_data;
+
+ result = Curl_rand(NULL, cid->data, cidlen);
+ if(result)
+ return NGTCP2_ERR_CALLBACK_FAILURE;
+ cid->datalen = cidlen;
+
+ result = Curl_rand(NULL, token->data, sizeof(token->data));
+ if(result)
+ return NGTCP2_ERR_CALLBACK_FAILURE;
+
+ return 0;
+}
+#endif
+
static int cb_recv_rx_key(ngtcp2_conn *tconn, ngtcp2_encryption_level level,
void *user_data)
{
@@ -877,6 +899,12 @@ static ngtcp2_callbacks ng_callbacks = {
#ifdef NGTCP2_CALLBACKS_V2 /* ngtcp2 v1.14.0+ */
NULL, /* begin_path_validation */
#endif
+#ifdef NGTCP2_CALLBACKS_V3 /* ngtcp2 v1.22.0+ */
+ NULL, /* recv_stateless_reset2 */
+ cb_get_new_connection_id2, /* get_new_connection_id2 */
+ NULL, /* dcid_status2 */
+ ngtcp2_crypto_get_path_challenge_data2_cb, /* get_path_challenge_data2 */
+#endif
};
#if defined(_MSC_VER) && defined(_DLL)