Skip to content

Commit 00eb41d

Browse files
authored
Merge branch 'curl:master' into master
2 parents 0fc9e16 + 8e93a74 commit 00eb41d

133 files changed

Lines changed: 2101 additions & 2053 deletions

Some content is hidden

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

.github/scripts/spacecheck.pl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
"^tests/data/test",
3535
);
3636

37-
my @mixed_eol = (
38-
"^tests/data/test",
39-
);
40-
4137
my @need_crlf = (
4238
"\\.(bat|sln)\$",
4339
);
@@ -109,8 +105,7 @@ sub eol_detect {
109105

110106
my $eol = eol_detect($content);
111107

112-
if($eol eq "" &&
113-
!fn_match($filename, @mixed_eol)) {
108+
if($eol eq "") {
114109
push @err, "content: has mixed EOL types";
115110
}
116111

@@ -120,8 +115,7 @@ sub eol_detect {
120115
}
121116

122117
if($eol ne "lf" && $content ne "" &&
123-
!fn_match($filename, @need_crlf) &&
124-
!fn_match($filename, @mixed_eol)) {
118+
!fn_match($filename, @need_crlf)) {
125119
push @err, "content: must use LF EOL for this file type";
126120
}
127121

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,8 @@ if(CURL_USE_GNUTLS)
934934
list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}")
935935
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}")
936936
curl_required_libpaths("${GNUTLS_LIBRARY_DIRS}")
937+
# In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds.
938+
# Detecting actual TLS-SRP support needs poking the API at runtime.
937939
check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP)
938940
cmake_pop_check_state()
939941
endif()
@@ -1549,7 +1551,7 @@ if(_curl_ca_bundle_supported)
15491551
unset(CURL_CA_PATH CACHE)
15501552
elseif(CURL_CA_PATH STREQUAL "auto")
15511553
unset(CURL_CA_PATH CACHE)
1552-
if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32)
1554+
if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32 AND NOT USE_APPLE_SECTRUST)
15531555
set(_curl_ca_path_autodetect TRUE)
15541556
endif()
15551557
else()

docs/runtests.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ Enable verbose output. Speaks more than by default. If used in conjunction
289289
with parallel testing, it is difficult to associate the logs with the specific
290290
test being run.
291291

292+
## `-w`
293+
294+
Verify test data.
295+
292296
## `-vc \<curl\>`
293297

294298
Provide a path to a custom curl binary to run when verifying that the servers

docs/tests/FILEFORMAT.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ For example, to insert the word hello 100 times:
7878

7979
## Whitespace
8080

81+
To force CRLF newline, add this macro to the end of the line:
82+
83+
%CR - carriage return
84+
8185
To add significant whitespace characters at the end of the line, or to empty
8286
lines:
8387

lib/conncache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,9 @@ bool Curl_cpool_conn_now_idle(struct Curl_easy *data,
536536
struct cpool *cpool = cpool_get_instance(data);
537537
bool kept = TRUE;
538538

539+
if(!data)
540+
return kept;
541+
539542
if(!data->multi->maxconnects) {
540543
unsigned int running = Curl_multi_xfers_running(data->multi);
541544
maxconnects = (running <= UINT_MAX / 4) ? running * 4 : UINT_MAX;

lib/vtls/gtls.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,12 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
877877
infof(data, "Using TLS-SRP username: %s", config->username);
878878

879879
rc = gnutls_srp_allocate_client_credentials(&gtls->srp_client_cred);
880-
if(rc != GNUTLS_E_SUCCESS) {
880+
if(rc == GNUTLS_E_UNIMPLEMENTED_FEATURE) {
881+
failf(data, "GnuTLS: TLS-SRP support not built in: %s",
882+
gnutls_strerror(rc));
883+
return CURLE_NOT_BUILT_IN;
884+
}
885+
else if(rc != GNUTLS_E_SUCCESS) {
881886
failf(data, "gnutls_srp_allocate_client_cred() failed: %s",
882887
gnutls_strerror(rc));
883888
return CURLE_OUT_OF_MEMORY;

m4/curl-gnutls.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ if test "$GNUTLS_ENABLED" = "1"; then
156156
157157
dnl ---
158158
dnl We require GnuTLS with SRP support.
159+
dnl
160+
dnl In GnuTLS 3.8.0 (2023-02-10) and upper, this check always succeeds.
161+
dnl Detecting actual TLS-SRP support needs poking the API at runtime.
159162
dnl ---
160163
AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
161164
[

src/tool_help.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,18 @@ static void print_category(unsigned int category, unsigned int cols)
8787
if(len > longdesc)
8888
longdesc = len;
8989
}
90-
if(longopt + longdesc > cols)
90+
91+
if(longdesc > cols)
92+
longopt = 0; /* avoid wrap-around */
93+
else if(longopt + longdesc > cols)
9194
longopt = cols - longdesc;
9295

9396
for(i = 0; helptext[i].opt; ++i)
9497
if(helptext[i].categories & category) {
9598
size_t opt = longopt;
9699
size_t desclen = strlen(helptext[i].desc);
97-
if(opt + desclen >= (cols - 2)) {
100+
/* avoid wrap-around */
101+
if(cols >= 2 && opt + desclen >= (cols - 2)) {
98102
if(desclen < (cols - 2))
99103
opt = (cols - 3) - desclen;
100104
else

src/tool_ipfs.c

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -165,23 +165,15 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
165165
}
166166

167167
/* get gateway parts */
168-
if(curl_url_get(gatewayurl, CURLUPART_HOST,
169-
&gwhost, CURLU_URLDECODE)) {
170-
goto clean;
171-
}
172-
173-
if(curl_url_get(gatewayurl, CURLUPART_SCHEME,
174-
&gwscheme, CURLU_URLDECODE)) {
175-
goto clean;
176-
}
177-
178-
curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE);
179-
180-
if(curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE))
168+
if(curl_url_get(gatewayurl, CURLUPART_HOST, &gwhost, CURLU_URLDECODE) ||
169+
curl_url_get(gatewayurl, CURLUPART_SCHEME, &gwscheme, CURLU_URLDECODE) ||
170+
curl_url_get(gatewayurl, CURLUPART_PORT, &gwport, CURLU_URLDECODE) ||
171+
curl_url_get(gatewayurl, CURLUPART_PATH, &gwpath, CURLU_URLDECODE))
181172
goto clean;
182173

183174
/* get the path from user input */
184-
curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE);
175+
if(curl_url_get(uh, CURLUPART_PATH, &inputpath, CURLU_URLDECODE))
176+
goto clean;
185177
/* inputpath might be NULL or a valid pointer now */
186178

187179
/* set gateway parts in input url */
@@ -198,13 +190,9 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url,
198190
has_trailing_slash(gwpath) ? "" : "/",
199191
protocol, cid,
200192
inputpath ? inputpath : "");
201-
if(!pathbuffer) {
202-
goto clean;
203-
}
204-
205-
if(curl_url_set(uh, CURLUPART_PATH, pathbuffer, CURLU_URLENCODE)) {
193+
if(!pathbuffer ||
194+
curl_url_set(uh, CURLUPART_PATH, pathbuffer, CURLU_URLENCODE))
206195
goto clean;
207-
}
208196

209197
/* Free whatever it has now, rewriting is next */
210198
tool_safefree(*url);

src/tool_operate.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,7 @@ static void on_uv_socket(uv_poll_t *req, int status, int events)
15491549

15501550
curl_multi_socket_action(c->uv->s->multi, c->sockfd, flags,
15511551
&c->uv->s->still_running);
1552+
progress_meter(c->uv->s->multi, &c->uv->s->start, FALSE);
15521553
}
15531554

15541555
/* callback from libuv when timeout expires */
@@ -1561,6 +1562,7 @@ static void on_uv_timeout(uv_timer_t *req)
15611562
if(uv && uv->s) {
15621563
curl_multi_socket_action(uv->s->multi, CURL_SOCKET_TIMEOUT, 0,
15631564
&uv->s->still_running);
1565+
progress_meter(uv->s->multi, &uv->s->start, FALSE);
15641566
}
15651567
}
15661568

@@ -1733,7 +1735,6 @@ static CURLcode check_finished(struct parastate *s)
17331735
int rc;
17341736
CURLMsg *msg;
17351737
bool checkmore = FALSE;
1736-
progress_meter(s->multi, &s->start, FALSE);
17371738
do {
17381739
msg = curl_multi_info_read(s->multi, &rc);
17391740
if(msg) {
@@ -1875,6 +1876,8 @@ static CURLcode parallel_transfers(CURLSH *share)
18751876
s->mcode = curl_multi_poll(s->multi, NULL, 0, 1000, NULL);
18761877
if(!s->mcode)
18771878
s->mcode = curl_multi_perform(s->multi, &s->still_running);
1879+
1880+
progress_meter(s->multi, &s->start, FALSE);
18781881
}
18791882

18801883
(void)progress_meter(s->multi, &s->start, TRUE);
@@ -2116,22 +2119,21 @@ static CURLcode transfer_per_config(struct OperationConfig *config,
21162119
bool *added,
21172120
bool *skipped)
21182121
{
2119-
CURLcode result = CURLE_OK;
2122+
CURLcode result;
21202123
*added = FALSE;
21212124

21222125
/* Check we have a url */
21232126
if(!config->url_list || !config->url_list->url) {
21242127
helpf("(%d) no URL specified", CURLE_FAILED_INIT);
2125-
return CURLE_FAILED_INIT;
2128+
result = CURLE_FAILED_INIT;
21262129
}
2127-
2128-
if(!result)
2130+
else {
21292131
result = cacertpaths(config);
2130-
2131-
if(!result) {
2132-
result = single_transfer(config, share, added, skipped);
2133-
if(!*added || result)
2134-
single_transfer_cleanup();
2132+
if(!result) {
2133+
result = single_transfer(config, share, added, skipped);
2134+
if(!*added || result)
2135+
single_transfer_cleanup();
2136+
}
21352137
}
21362138

21372139
return result;

0 commit comments

Comments
 (0)