mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
badwords: check indented lines in source code, fix fallouts
- badwords.pl: add `-a` option to check all lines in source code files. Before this patch indented lines were skipped (to avoid Markdown code fences.) - GHA/checksrc: use `-a` when verifying the source code. - GHA/checksrc: disable `So` and `But` rules for source code. - GHA/checksrc: add docs/examples to the verified sources. - badwords.txt: delete 4 duplicates. - badwords.txt: group and sort contractions. - badwords.txt: allow ` url = `, `DIR`, `<file name`. Closes #19536
This commit is contained in:
parent
8a968095df
commit
2dc71ba8bf
7
.github/scripts/badwords.pl
vendored
7
.github/scripts/badwords.pl
vendored
@ -20,7 +20,12 @@ use warnings;
|
||||
my @whitelist;
|
||||
my %alt;
|
||||
my %exactcase;
|
||||
my $skip_indented = 1;
|
||||
|
||||
if($ARGV[0] eq "-a") {
|
||||
shift @ARGV;
|
||||
$skip_indented = 0;
|
||||
}
|
||||
my %wl;
|
||||
if($ARGV[0] eq "-w") {
|
||||
shift @ARGV;
|
||||
@ -68,7 +73,7 @@ sub file {
|
||||
my $in = $_;
|
||||
$l++;
|
||||
chomp $in;
|
||||
if($in =~ /^ /) {
|
||||
if($skip_indented && $in =~ /^ /) {
|
||||
next;
|
||||
}
|
||||
# remove the link part
|
||||
|
||||
55
.github/scripts/badwords.txt
vendored
55
.github/scripts/badwords.txt
vendored
@ -10,59 +10,56 @@ tool chain:toolchain
|
||||
tool-chain:toolchain
|
||||
wild-card:wildcard
|
||||
wild card:wildcard
|
||||
\bit's:it is
|
||||
aren't:are not
|
||||
can't:cannot
|
||||
could've:could have
|
||||
couldn't:could not
|
||||
didn't:did not
|
||||
doesn't:does not
|
||||
don't=do not
|
||||
i'm:I am
|
||||
you've:You have
|
||||
we've:we have
|
||||
we're:we are
|
||||
we'll:we will
|
||||
we'd:we would
|
||||
they've:They have
|
||||
they're:They are
|
||||
they'll:They will
|
||||
isn't:is not
|
||||
it'd:it would
|
||||
should've:should have
|
||||
that's:that is
|
||||
there's:there is
|
||||
they'd:They would
|
||||
you've:you have
|
||||
they'll:They will
|
||||
they're:They are
|
||||
they've:They have
|
||||
we'd:we would
|
||||
we'll:we will
|
||||
we're:we are
|
||||
we've:we have
|
||||
won't:will not
|
||||
you'd:you would
|
||||
you'll:you will
|
||||
you're:you are
|
||||
should've:should have
|
||||
don't=do not
|
||||
could've:could have
|
||||
doesn't:does not
|
||||
isn't:is not
|
||||
aren't:are not
|
||||
you've:you have
|
||||
a html: an html
|
||||
a http: an http
|
||||
a ftp: an ftp
|
||||
a IPv4: an IPv4
|
||||
a IPv6: an IPv6
|
||||
url =URL
|
||||
url [^=]=URL
|
||||
[^/]internet\b=Internet
|
||||
isation:ization
|
||||
\bit's:it is
|
||||
it'd:it would
|
||||
there's:there is
|
||||
[^.]\. And: Rewrite it somehow?
|
||||
^(And|So|But) = Rewrite it somehow?
|
||||
\. But: Rewrite it somehow?
|
||||
\. So : Rewrite without "so" ?
|
||||
dir [^=]:directory
|
||||
dir [^=]=directory
|
||||
Dir [^=]=Directory
|
||||
sub-director:subdirector
|
||||
you'd:you would
|
||||
you'll:you will
|
||||
can't:cannot
|
||||
that's:that is
|
||||
web page:webpage
|
||||
host name\b:hostname
|
||||
host names\b:hostnames
|
||||
[^;]file name\b:filename
|
||||
[^;<]file name\b:filename
|
||||
file names\b:filenames
|
||||
\buser name\b:username
|
||||
\buser names\b:usernames
|
||||
\bpass phrase:passphrase
|
||||
didn't:did not
|
||||
doesn't:does not
|
||||
won't:will not
|
||||
couldn't:could not
|
||||
\bwill\b:rewrite to present tense
|
||||
\b32bit=32-bit
|
||||
\b64bit=64-bit
|
||||
|
||||
5
.github/workflows/checksrc.yml
vendored
5
.github/workflows/checksrc.yml
vendored
@ -174,6 +174,7 @@ jobs:
|
||||
- name: 'yamlcheck'
|
||||
run: .github/scripts/yamlcheck.sh
|
||||
|
||||
# we allow some extra in source code
|
||||
- name: 'badwords'
|
||||
run: grep -Ev '(\\bwill)' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include
|
||||
run: |
|
||||
# we allow some extra in source code
|
||||
grep -Ev '(\\bwill| But: | So : )' .github/scripts/badwords.txt | .github/scripts/badwords.pl -a src lib include docs/examples
|
||||
|
||||
@ -152,7 +152,7 @@ int main(int argc, char **argv)
|
||||
data twice!!! */
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
|
||||
|
||||
/* set user name and password for the authentication */
|
||||
/* set username and password for the authentication */
|
||||
curl_easy_setopt(curl, CURLOPT_USERPWD, "user:password");
|
||||
|
||||
/* Now run off and do what you have been told! */
|
||||
|
||||
@ -40,7 +40,7 @@ int main(void)
|
||||
/*
|
||||
Each single string should be written using the format
|
||||
HOST:PORT:CONNECT-TO-HOST:CONNECT-TO-PORT where HOST is the host of the
|
||||
request, PORT is the port of the request, CONNECT-TO-HOST is the host name
|
||||
request, PORT is the port of the request, CONNECT-TO-HOST is the hostname
|
||||
to connect to, and CONNECT-TO-PORT is the port to connect to.
|
||||
*/
|
||||
/* instead of curl.se:443, it resolves and uses example.com:443 but in other
|
||||
@ -53,12 +53,12 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, "https://curl.se/");
|
||||
|
||||
/* since this connects to the wrong host, checking the host name in the
|
||||
/* since this connects to the wrong host, checking the hostname in the
|
||||
server certificate fails, so unless we disable the check libcurl
|
||||
returns CURLE_PEER_FAILED_VERIFICATION */
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
/* Letting the wrong host name in the certificate be okay, the transfer
|
||||
/* Letting the wrong hostname in the certificate be okay, the transfer
|
||||
goes through but (most likely) causes a 404 or similar because it sends
|
||||
an unknown name in the Host: header field */
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
@ -47,7 +47,7 @@ static int print_cookies(CURL *curl)
|
||||
printf("Cookies, curl knows:\n");
|
||||
res = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_getinfo failed: %s\n",
|
||||
fprintf(stderr, "curl curl_easy_getinfo failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
@ -85,7 +85,7 @@ main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, ""); /* start cookie engine */
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
fprintf(stderr, "curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ main(void)
|
||||
"PREF", "hello example, I like you!");
|
||||
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
|
||||
fprintf(stderr, "curl curl_easy_setopt failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
@ -120,7 +120,7 @@ main(void)
|
||||
"expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.example.com");
|
||||
res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl curl_easy_setopt failed: %s\n",
|
||||
fprintf(stderr, "curl curl_easy_setopt failed: %s\n",
|
||||
curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
@ -129,14 +129,14 @@ main(void)
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
if(res != CURLE_OK) {
|
||||
fprintf(stderr, "Curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
fprintf(stderr, "curl perform failed: %s\n", curl_easy_strerror(res));
|
||||
return 1;
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Curl init failed!\n");
|
||||
fprintf(stderr, "curl init failed!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
|
||||
}
|
||||
fprintf(stream, "%c",
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
|
||||
@ -133,7 +133,7 @@ static void mcode_or_die(const char *where, CURLMcode code)
|
||||
|
||||
static void timer_cb(struct GlobalInfo *g, int revents);
|
||||
|
||||
/* Update the timer after curl_multi library does its thing. Curl informs the
|
||||
/* Update the timer after curl_multi library does its thing. curl informs the
|
||||
* application through this callback what it wants the new timeout to be,
|
||||
* after it does some work. */
|
||||
static int multi_timer_cb(CURLM *multi, long timeout_ms, struct GlobalInfo *g)
|
||||
@ -219,7 +219,7 @@ static void timer_cb(struct GlobalInfo *g, int revents)
|
||||
err = read(g->tfd, &count, sizeof(uint64_t));
|
||||
if(err == -1) {
|
||||
/* Note that we may call the timer callback even if the timerfd is not
|
||||
* readable. It's possible that there are multiple events stored in the
|
||||
* readable. It is possible that there are multiple events stored in the
|
||||
* epoll buffer (i.e. the timer may have fired multiple times). The event
|
||||
* count is cleared after the first call so future events in the epoll
|
||||
* buffer fails to read from the timer. */
|
||||
|
||||
@ -90,7 +90,7 @@ int main(void)
|
||||
/* get a FILE * of the file */
|
||||
hd_src = fopen(LOCAL_FILE, "rb");
|
||||
if(!hd_src) {
|
||||
printf("Couldn't open '%s': %s\n", LOCAL_FILE, strerror(errno));
|
||||
printf("Could not open '%s': %s\n", LOCAL_FILE, strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
|
||||
for(child = tidyGetChild(tnod); child; child = tidyGetNext(child) ) {
|
||||
ctmbstr name = tidyNodeGetName(child);
|
||||
if(name) {
|
||||
/* if it has a name, then it's an HTML tag ... */
|
||||
/* if it has a name, then it is an HTML tag ... */
|
||||
TidyAttr attr;
|
||||
printf("%*.*s%s ", indent, indent, "<", name);
|
||||
/* walk the attribute list */
|
||||
@ -62,7 +62,7 @@ void dumpNode(TidyDoc doc, TidyNode tnod, int indent)
|
||||
printf(">\n");
|
||||
}
|
||||
else {
|
||||
/* if it does not have a name, then it's probably text, cdata, etc... */
|
||||
/* if it does not have a name, then it is probably text, cdata, etc... */
|
||||
TidyBuffer buf;
|
||||
tidyBufInit(&buf);
|
||||
tidyNodeGetText(doc, child, &buf);
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Get a web page, extract the title with libxml.
|
||||
* Get a webpage, extract the title with libxml.
|
||||
* </DESC>
|
||||
|
||||
Written by Lars Nilsson
|
||||
|
||||
@ -90,7 +90,7 @@ static void dump(const char *text, int num, unsigned char *ptr,
|
||||
}
|
||||
fprintf(stderr, "%c",
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
|
||||
@ -78,7 +78,7 @@ static void dump(const char *text, unsigned char *ptr, size_t size, char nohex)
|
||||
}
|
||||
fprintf(stderr, "%c",
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
|
||||
@ -128,7 +128,7 @@ static void dump(const char *text, int num, unsigned char *ptr,
|
||||
}
|
||||
fprintf(stderr, "%c",
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
@ -305,7 +305,7 @@ int main(int argc, char **argv)
|
||||
num_transfers = 3; /* a suitable low default */
|
||||
|
||||
if(argc > 2)
|
||||
/* if given a file name, upload this! */
|
||||
/* if given a filename, upload this! */
|
||||
filename = argv[2];
|
||||
}
|
||||
else
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Very simple HTTP/3 GET
|
||||
* Simple HTTP/3 GET
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
@ -56,7 +56,7 @@ int main(void)
|
||||
|
||||
#ifdef SKIP_HOSTNAME_VERIFICATION
|
||||
/*
|
||||
* If the site you are connecting to uses a different host name that what
|
||||
* If the site you are connecting to uses a different hostname that what
|
||||
* they have mentioned in their server certificate's commonName (or
|
||||
* subjectAltName) fields, libcurl refuses to connect. You can skip this
|
||||
* check, but it makes the connection insecure.
|
||||
|
||||
@ -68,7 +68,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
|
||||
/* If the site you are connecting to uses a different host name that what
|
||||
/* If the site you are connecting to uses a different hostname that what
|
||||
* they have mentioned in their server certificate's commonName (or
|
||||
* subjectAltName) fields, libcurl refuses to connect. You can skip this
|
||||
* check, but it makes the connection insecure. */
|
||||
|
||||
@ -140,8 +140,8 @@ static int mem_addf(struct mem *mem, const char *format, ...)
|
||||
/* we need about 100 chars or less to write 95% of lines */
|
||||
x = 128;
|
||||
|
||||
/* first try: there's probably enough memory to write everything.
|
||||
second try: there's definitely enough memory to write everything. */
|
||||
/* first try: there is probably enough memory to write everything.
|
||||
second try: there is definitely enough memory to write everything. */
|
||||
for(i = 0; i < 2; ++i) {
|
||||
if(x < 0 || mem_need(mem, (size_t)x + 1) < 0)
|
||||
break;
|
||||
|
||||
@ -71,7 +71,7 @@ static void dump(const char *text, FILE *stream, unsigned char *ptr,
|
||||
}
|
||||
fprintf(stream, "%c",
|
||||
(ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80) ? ptr[i + c] : '.');
|
||||
/* check again for 0D0A, to avoid an extra \n if it's at width */
|
||||
/* check again for 0D0A, to avoid an extra \n if it is at width */
|
||||
if(nohex && (i + c + 2 < size) && ptr[i + c + 1] == 0x0D &&
|
||||
ptr[i + c + 2] == 0x0A) {
|
||||
i += (c + 3 - width);
|
||||
|
||||
@ -51,7 +51,7 @@ int main(void)
|
||||
|
||||
CURL_IGNORE_DEPRECATION(
|
||||
/* Fill in the file upload field. This makes libcurl load data from
|
||||
the given file name when curl_easy_perform() is called. */
|
||||
the given filename when curl_easy_perform() is called. */
|
||||
curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
CURLFORM_COPYNAME, "sendfile",
|
||||
|
||||
@ -97,7 +97,7 @@ int main(void)
|
||||
pull_one_url,
|
||||
(void *)&targs[i]);
|
||||
if(error)
|
||||
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
|
||||
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
|
||||
else
|
||||
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ int main(void)
|
||||
/* extract hostname from the parsed URL */
|
||||
uc = curl_url_get(h, CURLUPART_HOST, &host, 0);
|
||||
if(!uc) {
|
||||
printf("Host name: %s\n", host);
|
||||
printf("Hostname: %s\n", host);
|
||||
curl_free(host);
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
|
||||
/* If the site you are connecting to uses a different host name that what
|
||||
/* If the site you are connecting to uses a different hostname that what
|
||||
* they have mentioned in their server certificate's commonName (or
|
||||
* subjectAltName) fields, libcurl refuses to connect. You can skip this
|
||||
* check, but it makes the connection insecure. */
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Very simple RTSP request sending OPTIONS.
|
||||
* Simple RTSP request sending OPTIONS.
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Very simple HTTP GET
|
||||
* Simple HTTP GET
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
/* <DESC>
|
||||
* Very simple HTTP POST
|
||||
* Simple HTTP POST
|
||||
* </DESC>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
@ -133,7 +133,7 @@ void *create_thread(void *progress_bar)
|
||||
pull_one_url,
|
||||
NULL);
|
||||
if(error)
|
||||
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
|
||||
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
|
||||
else
|
||||
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ int main(void)
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
#endif
|
||||
|
||||
/* If the site you are connecting to uses a different host name that what
|
||||
/* If the site you are connecting to uses a different hostname that what
|
||||
* they have mentioned in their server certificate's commonName (or
|
||||
* subjectAltName) fields, libcurl refuses to connect. You can skip this
|
||||
* check, but it makes the connection insecure. */
|
||||
|
||||
@ -91,7 +91,7 @@ int main(int argc, char **argv)
|
||||
pull_one_url,
|
||||
(void *)&i);
|
||||
if(error)
|
||||
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
|
||||
fprintf(stderr, "Could not run thread number %d, errno %d\n", i, error);
|
||||
else
|
||||
fprintf(stderr, "Thread %d, gets %s\n", i, urls[i]);
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ int main(void)
|
||||
if(res)
|
||||
return (int)res;
|
||||
|
||||
/* init Curl URL */
|
||||
/* init curl URL */
|
||||
urlp = curl_url();
|
||||
uc = curl_url_set(urlp, CURLUPART_URL,
|
||||
"http://example.com/path/index.html", 0);
|
||||
|
||||
@ -559,7 +559,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* IPv6 host name */
|
||||
/* IPv6 hostname */
|
||||
if(curlx_str_until(&p, &dsthost, MAX_IPADR_LEN, ']') ||
|
||||
curlx_str_single(&p, ']')) {
|
||||
infof(data, "Bad alt-svc IPv6 hostname, ignoring.");
|
||||
|
||||
@ -311,7 +311,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf,
|
||||
|
||||
rc = nghttp2_session_callbacks_new(&cbs);
|
||||
if(rc) {
|
||||
failf(data, "Couldn't initialize nghttp2 callbacks");
|
||||
failf(data, "Could not initialize nghttp2 callbacks");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -331,7 +331,7 @@ static CURLcode cf_h2_proxy_ctx_init(struct Curl_cfilter *cf,
|
||||
/* The nghttp2 session is not yet setup, do it */
|
||||
rc = proxy_h2_client_new(cf, cbs);
|
||||
if(rc) {
|
||||
failf(data, "Couldn't initialize nghttp2");
|
||||
failf(data, "Could not initialize nghttp2");
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
@ -664,7 +664,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
|
||||
/* Do not fall back to treating it as a hostname */
|
||||
char buffer[STRERROR_LEN];
|
||||
data->state.os_errno = error = SOCKERRNO;
|
||||
failf(data, "Couldn't bind to interface '%s' with errno %d: %s",
|
||||
failf(data, "Could not bind to interface '%s' with errno %d: %s",
|
||||
iface, error, curlx_strerror(error, buffer, sizeof(buffer)));
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
}
|
||||
@ -768,7 +768,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
|
||||
char buffer[STRERROR_LEN];
|
||||
data->state.errorbuf = FALSE;
|
||||
data->state.os_errno = error = SOCKERRNO;
|
||||
failf(data, "Couldn't bind to '%s' with errno %d: %s", host,
|
||||
failf(data, "Could not bind to '%s' with errno %d: %s", host,
|
||||
error, curlx_strerror(error, buffer, sizeof(buffer)));
|
||||
return CURLE_INTERFACE_FAILED;
|
||||
}
|
||||
|
||||
@ -458,7 +458,7 @@ parse_cookie_header(struct Curl_easy *data,
|
||||
*/
|
||||
|
||||
if(!co->name) {
|
||||
/* The very first name/value pair is the actual cookie name */
|
||||
/* The first name/value pair is the actual cookie name */
|
||||
if(!sep)
|
||||
/* Bad name/value pair. */
|
||||
return CURLE_OK;
|
||||
|
||||
@ -62,7 +62,7 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen)
|
||||
if(strlen(force_hostname) < (size_t)namelen)
|
||||
strcpy(name, force_hostname);
|
||||
else
|
||||
return 1; /* can't do it */
|
||||
return 1; /* cannot do it */
|
||||
err = 0;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -142,7 +142,7 @@ static bool fix_excessive_path(const TCHAR *in, TCHAR **out)
|
||||
else if(!wcsncmp(fbuf, L"\\\\.\\", 4))
|
||||
fbuf[2] = '?';
|
||||
else if(!wcsncmp(fbuf, L"\\\\.", 3) || !wcsncmp(fbuf, L"\\\\?", 3)) {
|
||||
/* Unexpected, not UNC. The formatting doc doesn't allow this AFAICT. */
|
||||
/* Unexpected, not UNC. The formatting doc does not allow this AFAICT. */
|
||||
goto cleanup;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -160,7 +160,7 @@ static char *inet_ntop6(const unsigned char *src, char *dst, size_t size)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
/* Lower-case digits. Can't use the set from mprintf.c since this
|
||||
/* Lower-case digits. Cannot use the set from mprintf.c since this
|
||||
needs to work as a curlx function */
|
||||
static const unsigned char ldigits[] = "0123456789abcdef";
|
||||
|
||||
|
||||
@ -180,7 +180,7 @@ int r_getaddrinfo(const char *node,
|
||||
curl_mfprintf(stderr, "ares_set_servers_ports_csv failed: %d", rc);
|
||||
/* Cleanup */
|
||||
ares_destroy(channel);
|
||||
return EAI_MEMORY; /* we can't run */
|
||||
return EAI_MEMORY; /* we cannot run */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -275,7 +275,7 @@ static CURLcode file_connect(struct Curl_easy *data, bool *done)
|
||||
|
||||
file->fd = fd;
|
||||
if(!data->state.upload && (fd == -1)) {
|
||||
failf(data, "Couldn't open file %s", data->state.up.path);
|
||||
failf(data, "Could not open file %s", data->state.up.path);
|
||||
file_done(data, CURLE_FILE_COULDNT_READ_FILE, FALSE);
|
||||
return CURLE_FILE_COULDNT_READ_FILE;
|
||||
}
|
||||
|
||||
16
lib/ftp.c
16
lib/ftp.c
@ -1867,7 +1867,7 @@ static CURLcode ftp_state_pasv_resp(struct Curl_easy *data,
|
||||
}
|
||||
|
||||
if(!*str) {
|
||||
failf(data, "Couldn't interpret the 227-response");
|
||||
failf(data, "Could not interpret the 227-response");
|
||||
return CURLE_FTP_WEIRD_227_FORMAT;
|
||||
}
|
||||
|
||||
@ -2202,7 +2202,7 @@ static CURLcode ftp_state_type_resp(struct Curl_easy *data,
|
||||
/* "sasserftpd" and "(u)r(x)bot ftpd" both responds with 226 after a
|
||||
successful 'TYPE I'. While that is not as RFC959 says, it is still a
|
||||
positive response code and we allow that. */
|
||||
failf(data, "Couldn't set desired mode");
|
||||
failf(data, "Could not set desired mode");
|
||||
return CURLE_FTP_COULDNT_SET_TYPE;
|
||||
}
|
||||
if(ftpcode != 200)
|
||||
@ -2392,7 +2392,7 @@ static CURLcode ftp_state_rest_resp(struct Curl_easy *data,
|
||||
|
||||
case FTP_RETR_REST:
|
||||
if(ftpcode != 350) {
|
||||
failf(data, "Couldn't use REST");
|
||||
failf(data, "Could not use REST");
|
||||
result = CURLE_FTP_COULDNT_USE_REST;
|
||||
}
|
||||
else {
|
||||
@ -2537,7 +2537,7 @@ static CURLcode ftp_state_get_resp(struct Curl_easy *data,
|
||||
}
|
||||
else {
|
||||
if((instate == FTP_LIST) && (ftpcode == 450)) {
|
||||
/* simply no matching files in the dir listing */
|
||||
/* simply no matching files in the directory listing */
|
||||
ftp->transfer = PPTRANSFER_NONE; /* do not download anything */
|
||||
ftp_state(data, ftpc, FTP_STOP); /* this phase is over */
|
||||
}
|
||||
@ -3052,7 +3052,7 @@ static CURLcode ftp_pp_statemachine(struct Curl_easy *data,
|
||||
|
||||
case FTP_MKD:
|
||||
if((ftpcode/100 != 2) && !ftpc->count3--) {
|
||||
/* failure to MKD the dir */
|
||||
/* failure to MKD the directory */
|
||||
failf(data, "Failed to MKD dir: %03d", ftpcode);
|
||||
result = CURLE_REMOTE_ACCESS_DENIED;
|
||||
}
|
||||
@ -3306,7 +3306,7 @@ static CURLcode ftp_done(struct Curl_easy *data, CURLcode status,
|
||||
}
|
||||
}
|
||||
if(ftpc->prevpath)
|
||||
infof(data, "Remembering we are in dir \"%s\"", ftpc->prevpath);
|
||||
infof(data, "Remembering we are in directory \"%s\"", ftpc->prevpath);
|
||||
}
|
||||
|
||||
/* shut down the socket to inform the server we are done */
|
||||
@ -4192,7 +4192,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data,
|
||||
|
||||
ftpc->dirs[0].start = 0;
|
||||
ftpc->dirs[0].len = (int)dirlen;
|
||||
ftpc->dirdepth = 1; /* we consider it to be a single dir */
|
||||
ftpc->dirdepth = 1; /* we consider it to be a single directory */
|
||||
fileName = slashPos + 1; /* rest is filename */
|
||||
}
|
||||
else
|
||||
@ -4208,7 +4208,7 @@ CURLcode ftp_parse_url_path(struct Curl_easy *data,
|
||||
size_t dirAlloc = numof_slashes(rawPath);
|
||||
|
||||
if(dirAlloc >= FTP_MAX_DIR_DEPTH)
|
||||
/* suspiciously deep dir hierarchy */
|
||||
/* suspiciously deep directory hierarchy */
|
||||
return CURLE_URL_MALFORMAT;
|
||||
|
||||
if(dirAlloc) {
|
||||
|
||||
@ -51,7 +51,7 @@ static void copy_header_external(struct Curl_header_store *hs,
|
||||
h->index = index;
|
||||
/* this will randomly OR a reserved bit for the sole purpose of making it
|
||||
impossible for applications to do == comparisons, as that would otherwise
|
||||
be very tempting and then lead to the reserved bits not being reserved
|
||||
be tempting and then lead to the reserved bits not being reserved
|
||||
anymore. */
|
||||
h->origin = (unsigned int)(hs->type | (1 << 27));
|
||||
h->anchor = e;
|
||||
|
||||
@ -956,7 +956,7 @@ out:
|
||||
/* we got a response, create a dns entry, add to cache, return */
|
||||
dns = Curl_dnscache_mk_entry(data, addr, hostname, 0, port, FALSE);
|
||||
if(!dns || Curl_dnscache_add(data, dns)) {
|
||||
/* this is OOM or similar, don't store such negative resolves */
|
||||
/* this is OOM or similar, do not store such negative resolves */
|
||||
keep_negative = FALSE;
|
||||
goto error;
|
||||
}
|
||||
@ -1393,7 +1393,7 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
|
||||
error = FALSE;
|
||||
err:
|
||||
if(error) {
|
||||
failf(data, "Couldn't parse CURLOPT_RESOLVE entry '%s'",
|
||||
failf(data, "Could not parse CURLOPT_RESOLVE entry '%s'",
|
||||
hostp->data);
|
||||
Curl_freeaddrinfo(head);
|
||||
return CURLE_SETOPT_OPTION_SYNTAX;
|
||||
|
||||
@ -277,7 +277,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname,
|
||||
blen = ntail;
|
||||
}
|
||||
}
|
||||
/* avoid curl_strequal because the host name is not null-terminated */
|
||||
/* avoid curl_strequal because the hostname is not null-terminated */
|
||||
if((hlen == ntail) && curl_strnequal(hostname, sts->host, hlen))
|
||||
return sts;
|
||||
}
|
||||
|
||||
10
lib/http.c
10
lib/http.c
@ -504,7 +504,7 @@ static CURLcode http_perhapsrewind(struct Curl_easy *data,
|
||||
return CURLE_OK;
|
||||
|
||||
if(abort_upload) {
|
||||
/* We'd like to abort the upload - but should we? */
|
||||
/* We would like to abort the upload - but should we? */
|
||||
#ifdef USE_NTLM
|
||||
if((data->state.authproxy.picked == CURLAUTH_NTLM) ||
|
||||
(data->state.authhost.picked == CURLAUTH_NTLM)) {
|
||||
@ -1716,7 +1716,7 @@ CURLcode Curl_add_custom_headers(struct Curl_easy *data,
|
||||
curlx_str_untilnl(&p, &val, MAX_HTTP_RESP_HEADER_SIZE);
|
||||
curlx_str_trimblanks(&val);
|
||||
if(!curlx_strlen(&val))
|
||||
/* no content, don't send this */
|
||||
/* no content, do not send this */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@ -2404,7 +2404,7 @@ static CURLcode http_add_content_hds(struct Curl_easy *data,
|
||||
(data->req.authneg ||
|
||||
!Curl_checkheaders(data, STRCONST("Content-Length")))) {
|
||||
/* we allow replacing this header if not during auth negotiation,
|
||||
although it is not very wise to actually set your own */
|
||||
although it is not wise to actually set your own */
|
||||
result = curlx_dyn_addf(r, "Content-Length: %" FMT_OFF_T "\r\n",
|
||||
req_clen);
|
||||
}
|
||||
@ -4018,7 +4018,7 @@ static CURLcode http_on_response(struct Curl_easy *data,
|
||||
*
|
||||
* The check for close above is done simply because of something
|
||||
* else has already deemed the connection to get closed then
|
||||
* something else should've considered the big picture and we
|
||||
* something else should have considered the big picture and we
|
||||
* avoid this check.
|
||||
*
|
||||
*/
|
||||
@ -4187,7 +4187,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
|
||||
k->httpcode = (p[0] - '0') * 100 + (p[1] - '0') * 10 +
|
||||
(p[2] - '0');
|
||||
/* RFC 9112 requires a single space following the status code,
|
||||
but the browsers don't so let's not insist */
|
||||
but the browsers do not so let's not insist */
|
||||
fine_statusline = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf,
|
||||
|
||||
rc = nghttp2_session_callbacks_new(&cbs);
|
||||
if(rc) {
|
||||
failf(data, "Couldn't initialize nghttp2 callbacks");
|
||||
failf(data, "Could not initialize nghttp2 callbacks");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@ -530,7 +530,7 @@ static CURLcode cf_h2_ctx_open(struct Curl_cfilter *cf,
|
||||
/* The nghttp2 session is not yet setup, do it */
|
||||
rc = h2_client_new(cf, cbs);
|
||||
if(rc) {
|
||||
failf(data, "Couldn't initialize nghttp2");
|
||||
failf(data, "Could not initialize nghttp2");
|
||||
goto out;
|
||||
}
|
||||
ctx->max_concurrent_streams = DEFAULT_MAX_CONCURRENT_STREAMS;
|
||||
@ -972,7 +972,7 @@ static int push_promise(struct Curl_cfilter *cf,
|
||||
|
||||
rv = set_transfer_url(newhandle, &heads);
|
||||
if(rv) {
|
||||
CURL_TRC_CF(data, cf, "[%d] PUSH_PROMISE, failed to set url -> %d",
|
||||
CURL_TRC_CF(data, cf, "[%d] PUSH_PROMISE, failed to set URL -> %d",
|
||||
frame->promised_stream_id, rv);
|
||||
discard_newhandle(cf, newhandle);
|
||||
rv = CURL_PUSH_DENY;
|
||||
|
||||
@ -1038,7 +1038,7 @@ CURLMcode Curl_multi_pollset(struct Curl_easy *data,
|
||||
|
||||
case MSTATE_RESOLVING:
|
||||
result = Curl_resolv_pollset(data, ps);
|
||||
/* connection filters are not involved in this phase. It's ok if we get no
|
||||
/* connection filters are not involved in this phase. It is OK if we get no
|
||||
* sockets to wait for. Resolving can wake up from other sources. */
|
||||
expect_sockets = FALSE;
|
||||
break;
|
||||
|
||||
@ -340,7 +340,7 @@ static CURLMcode mev_pollset_diff(struct Curl_multi *multi,
|
||||
/* What was the previous action the transfer had regarding this socket?
|
||||
* If the transfer is new to the socket, disregard the information
|
||||
* in `last_poll`, because the socket might have been destroyed and
|
||||
* reopened. We'd have cleared the sh_entry for that, but the socket
|
||||
* reopened. We would have cleared the sh_entry for that, but the socket
|
||||
* might still be mentioned in the hashed pollsets. */
|
||||
last_action = 0;
|
||||
if(first_time) {
|
||||
|
||||
@ -1742,9 +1742,8 @@ static CURLcode pop3_write(struct Curl_easy *data, const char *str,
|
||||
|
||||
/* Did we have a partial match which has subsequently failed? */
|
||||
if(prev && prev >= pop3c->eob) {
|
||||
/* Strip can only be non-zero for the very first mismatch after CRLF
|
||||
and then both prev and strip are equal and nothing will be output
|
||||
below */
|
||||
/* Strip can only be non-zero for the first mismatch after CRLF and
|
||||
then both prev and strip are equal and nothing will be output below */
|
||||
while(prev && pop3c->strip) {
|
||||
prev--;
|
||||
pop3c->strip--;
|
||||
|
||||
@ -280,7 +280,7 @@ timediff_t Curl_pgrsLimitWaitTime(struct pgrs_dir *d,
|
||||
should_ms = (timediff_t) (1000 * bytes / bytes_per_sec);
|
||||
}
|
||||
else {
|
||||
/* very large `bytes`, first calc the seconds it should have taken.
|
||||
/* large `bytes`, first calc the seconds it should have taken.
|
||||
* if that is small enough, convert to milliseconds. */
|
||||
should_ms = (timediff_t) (bytes / bytes_per_sec);
|
||||
if(should_ms < TIMEDIFF_T_MAX/1000)
|
||||
|
||||
@ -308,7 +308,7 @@ static CURLproxycode socks4_req_add_user(struct socks_state *sx,
|
||||
return CURLPX_SEND_REQUEST;
|
||||
}
|
||||
else {
|
||||
/* empty user name */
|
||||
/* empty username */
|
||||
unsigned char b = 0;
|
||||
result = Curl_bufq_write(&sx->iobuf, &b, 1, &nwritten);
|
||||
if(result || (nwritten != 1))
|
||||
|
||||
@ -49,7 +49,7 @@ CURLcode Curl_speedcheck(struct Curl_easy *data,
|
||||
if((data->progress.current_speed >= 0) && data->set.low_speed_time) {
|
||||
if(data->progress.current_speed < data->set.low_speed_limit) {
|
||||
if(!data->state.keeps_speed.tv_sec)
|
||||
/* under the limit at this very moment */
|
||||
/* under the limit at this moment */
|
||||
data->state.keeps_speed = now;
|
||||
else {
|
||||
/* how long has it been under the limit */
|
||||
|
||||
@ -1283,7 +1283,7 @@ static bool url_match_result(bool result, void *userdata)
|
||||
return TRUE;
|
||||
}
|
||||
else if(match->seen_single_use_conn && !match->seen_multiplex_conn) {
|
||||
/* We've seen a single-use, existing connection to the destination and
|
||||
/* We have seen a single-use, existing connection to the destination and
|
||||
* no multiplexed one. It seems safe to assume that the server does
|
||||
* not support multiplexing. */
|
||||
match->wait_pipe = FALSE;
|
||||
@ -2740,7 +2740,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||
data->set.str[STRING_NETRC_FILE]);
|
||||
if(ret && ((ret == NETRC_NO_MATCH) ||
|
||||
(data->set.use_netrc == CURL_NETRC_OPTIONAL))) {
|
||||
infof(data, "Couldn't find host %s in the %s file; using defaults",
|
||||
infof(data, "Could not find host %s in the %s file; using defaults",
|
||||
conn->host.name,
|
||||
(data->set.str[STRING_NETRC_FILE] ?
|
||||
data->set.str[STRING_NETRC_FILE] : ".netrc"));
|
||||
@ -2752,7 +2752,7 @@ static CURLcode override_login(struct Curl_easy *data,
|
||||
}
|
||||
else {
|
||||
if(!(conn->handler->flags&PROTOPT_USERPWDCTRL)) {
|
||||
/* if the protocol can't handle control codes in credentials, make
|
||||
/* if the protocol cannot handle control codes in credentials, make
|
||||
sure there are none */
|
||||
if(str_has_ctrl(*userp) || str_has_ctrl(*passwdp)) {
|
||||
failf(data, "control code detected in .netrc credentials");
|
||||
|
||||
@ -1940,7 +1940,7 @@ nomem:
|
||||
if(!n)
|
||||
bad = TRUE; /* empty hostname is not okay */
|
||||
else if(!urlencode) {
|
||||
/* if the host name part was not URL encoded here, it was set ready
|
||||
/* if the hostname part was not URL encoded here, it was set ready
|
||||
URL encoded so we need to decode it to check */
|
||||
size_t dlen;
|
||||
char *decoded = NULL;
|
||||
|
||||
@ -216,7 +216,7 @@ static bool auth_digest_get_key_value(const char *chlg, const char *key,
|
||||
if(curlx_str_cmp(&name, key)) {
|
||||
/* if this is our key, return the value */
|
||||
if(curlx_strlen(&data) >= buflen)
|
||||
/* doesn't fit */
|
||||
/* does not fit */
|
||||
return FALSE;
|
||||
memcpy(buf, curlx_str(&data), curlx_strlen(&data));
|
||||
buf[curlx_strlen(&data)] = 0;
|
||||
|
||||
@ -781,7 +781,7 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf,
|
||||
|
||||
if(nwritten < memlen) {
|
||||
/* This MUST not happen. Our recbuf is dimensioned to hold the
|
||||
* full max_stream_window and then some for this very reason. */
|
||||
* full max_stream_window and then some for this reason. */
|
||||
DEBUGASSERT(0);
|
||||
return CURLE_RECV_ERROR;
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ static CURLcode write_resp_raw(struct Curl_cfilter *cf,
|
||||
|
||||
if(nwritten < memlen) {
|
||||
/* This MUST not happen. Our recbuf is dimensioned to hold the
|
||||
* full max_stream_window and then some for this very reason. */
|
||||
* full max_stream_window and then some for this reason. */
|
||||
DEBUGASSERT(0);
|
||||
return CURLE_RECV_ERROR;
|
||||
}
|
||||
|
||||
@ -1574,8 +1574,8 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data,
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, "PWD\n", 4);
|
||||
Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp));
|
||||
|
||||
/* this sends an FTP-like "header" to the header callback so that the
|
||||
current directory can be read very similar to how it is read when
|
||||
/* this sends an FTP-like "header" to the header callback so that
|
||||
the current directory can be read similar to how it is read when
|
||||
using ordinary FTP. */
|
||||
result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp));
|
||||
free(tmp);
|
||||
@ -1860,7 +1860,7 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data,
|
||||
return SSH_NO_ERROR;
|
||||
}
|
||||
if(date > UINT_MAX)
|
||||
/* because the liubssh API can't deal with a larger value */
|
||||
/* because the liubssh API cannot deal with a larger value */
|
||||
date = UINT_MAX;
|
||||
if(!strncmp(cmd, "atime", 5))
|
||||
sshc->quote_attrs->atime = (uint32_t)date;
|
||||
|
||||
@ -878,8 +878,8 @@ static CURLcode sftp_quote(struct Curl_easy *data,
|
||||
Curl_debug(data, CURLINFO_HEADER_OUT, "PWD\n", 4);
|
||||
Curl_debug(data, CURLINFO_HEADER_IN, tmp, strlen(tmp));
|
||||
|
||||
/* this sends an FTP-like "header" to the header callback so that the
|
||||
current directory can be read very similar to how it is read when
|
||||
/* this sends an FTP-like "header" to the header callback so that
|
||||
the current directory can be read similar to how it is read when
|
||||
using ordinary FTP. */
|
||||
result = Curl_client_write(data, CLIENTWRITE_HEADER, tmp, strlen(tmp));
|
||||
free(tmp);
|
||||
|
||||
@ -148,7 +148,7 @@ CURLcode Curl_vtls_apple_verify(struct Curl_cfilter *cf,
|
||||
* add `kSecRevocationRequirePositiveResponse` to the Apple
|
||||
* Trust policies, it interprets this as it NEEDs a confirmation
|
||||
* of a cert being NOT REVOKED. Which not in general available for
|
||||
* certificates on the internet.
|
||||
* certificates on the Internet.
|
||||
* It seems that applications using this policy are expected to PIN
|
||||
* their certificate public keys or verification will fail.
|
||||
* This does not seem to be what we want here. */
|
||||
|
||||
@ -1688,7 +1688,7 @@ static CURLcode client_cert(struct Curl_easy *data,
|
||||
failf(data,
|
||||
"could not load PEM client certificate from %s, " OSSL_PACKAGE
|
||||
" error %s, "
|
||||
"(no key found, wrong pass phrase, or wrong file format?)",
|
||||
"(no key found, wrong passphrase, or wrong file format?)",
|
||||
(cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file),
|
||||
ossl_strerror(ERR_get_error(), error_buffer,
|
||||
sizeof(error_buffer)) );
|
||||
@ -1708,7 +1708,7 @@ static CURLcode client_cert(struct Curl_easy *data,
|
||||
failf(data,
|
||||
"could not load ASN1 client certificate from %s, " OSSL_PACKAGE
|
||||
" error %s, "
|
||||
"(no key found, wrong pass phrase, or wrong file format?)",
|
||||
"(no key found, wrong passphrase, or wrong file format?)",
|
||||
(cert_blob ? "CURLOPT_SSLCERT_BLOB" : cert_file),
|
||||
ossl_strerror(ERR_get_error(), error_buffer,
|
||||
sizeof(error_buffer)) );
|
||||
@ -5154,7 +5154,7 @@ CURLcode Curl_ossl_check_peer_cert(struct Curl_cfilter *cf,
|
||||
#endif
|
||||
|
||||
if(data->set.ssl.certinfo && !octx->reused_session) {
|
||||
/* asked to gather certificate info. Reused sessions don't have cert
|
||||
/* asked to gather certificate info. Reused sessions do not have cert
|
||||
chains */
|
||||
result = ossl_certchain(data, octx->ssl);
|
||||
if(result)
|
||||
@ -5684,7 +5684,7 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex,
|
||||
|
||||
cert = SSL_get1_peer_certificate(octx->ssl);
|
||||
if(!cert)
|
||||
/* No server certificate, don't do channel binding */
|
||||
/* No server certificate, do not do channel binding */
|
||||
return CURLE_OK;
|
||||
|
||||
if(!OBJ_find_sigid_algs(X509_get_signature_nid(cert), &algo_nid, NULL)) {
|
||||
|
||||
@ -1286,7 +1286,7 @@ schannel_connect_step2(struct Curl_cfilter *cf, struct Curl_easy *data)
|
||||
|
||||
/* The socket must be writeable (or a poll error occurred) before we call
|
||||
InitializeSecurityContext to continue processing the received TLS
|
||||
records. This is because that function is not idempotent and we don't
|
||||
records. This is because that function is not idempotent and we do not
|
||||
support partial save/resume sending replies of handshake tokens. */
|
||||
if(!SOCKET_WRITABLE(Curl_conn_cf_get_socket(cf, data), 0)) {
|
||||
SCH_DEV(infof(data, "schannel: handshake waiting for writeable socket"));
|
||||
@ -1809,7 +1809,7 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data,
|
||||
* data needs to be sent then we block for a writeable socket that should
|
||||
* be writeable immediately except for OS resource constraints. For caller
|
||||
* send if handshake data needs to be received then we block for a readable
|
||||
* socket, which could take some time, but it's more likely the user has
|
||||
* socket, which could take some time, but it is more likely the user has
|
||||
* called recv since they had called it prior (only recv can start
|
||||
* renegotiation and probably the user is going to call it again to get
|
||||
* more of their data before calling send).
|
||||
|
||||
@ -1423,7 +1423,7 @@ static CURLcode ssl_cf_connect_deferred(struct Curl_cfilter *cf,
|
||||
result = ssl_cf_set_earlydata(cf, data, buf, blen);
|
||||
if(result)
|
||||
return result;
|
||||
/* we buffered any early data we'd like to send. Actually
|
||||
/* we buffered any early data we would like to send. Actually
|
||||
* do the connect now which sends it and performs the handshake. */
|
||||
connssl->earlydata_state = ssl_earlydata_sending;
|
||||
connssl->earlydata_skip = Curl_bufq_len(&connssl->earlydata);
|
||||
|
||||
@ -1725,7 +1725,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf,
|
||||
if(ret == WOLFSSL_SUCCESS &&
|
||||
conn_config->verifyhost &&
|
||||
!connssl->peer.sni) {
|
||||
/* we have an IP address as host name. */
|
||||
/* we have an IP address as hostname. */
|
||||
WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(wssl->ssl);
|
||||
if(!cert) {
|
||||
failf(data, "unable to get peer certificate");
|
||||
|
||||
2
lib/ws.c
2
lib/ws.c
@ -1037,7 +1037,7 @@ static CURLcode ws_enc_send(struct Curl_easy *data,
|
||||
* that needs to be encoded into the buffer */
|
||||
if(buflen < ws->sendbuf_payload) {
|
||||
/* We have been called with LESS buffer data than before. This
|
||||
* is not how it's supposed too work. */
|
||||
* is not how it is supposed too work. */
|
||||
failf(data, "[WS] curl_ws_send() called with smaller 'buflen' than "
|
||||
"bytes already buffered in previous call, %zu vs %zu",
|
||||
buflen, ws->sendbuf_payload);
|
||||
|
||||
@ -212,11 +212,11 @@ static CURLcode ssh_setopts(struct OperationConfig *config, CURL *curl)
|
||||
config->knownhosts = known;
|
||||
}
|
||||
else if(!config->hostpubmd5 && !config->hostpubsha256) {
|
||||
errorf("Couldn't find a known_hosts file");
|
||||
errorf("Could not find a known_hosts file");
|
||||
return CURLE_FAILED_INIT;
|
||||
}
|
||||
else
|
||||
warnf("Couldn't find a known_hosts file");
|
||||
warnf("Could not find a known_hosts file");
|
||||
}
|
||||
return CURLE_OK; /* ignore if SHA256 did not work */
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ static bool waitfd(int waitms, int fd)
|
||||
struct timeval timeout;
|
||||
|
||||
if(fd >= FD_SETSIZE)
|
||||
/* can't wait! */
|
||||
/* cannot wait! */
|
||||
return FALSE;
|
||||
|
||||
/* wait this long at the most */
|
||||
|
||||
@ -55,8 +55,8 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
|
||||
|
||||
if(offset > OUR_MAX_SEEK_O) {
|
||||
/* Some precaution code to work around problems with different data sizes
|
||||
to allow seeking >32-bit even if off_t is 32-bit. Should be very rare
|
||||
and is really valid on weirdo-systems. */
|
||||
to allow seeking >32-bit even if off_t is 32-bit. Should be rare and
|
||||
is really valid on weirdo-systems. */
|
||||
curl_off_t left = offset;
|
||||
|
||||
if(whence != SEEK_SET)
|
||||
|
||||
@ -874,7 +874,7 @@ curl_socket_t win32_stdin_read_thread(void)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Start up the thread. We don't bother keeping a reference to it
|
||||
/* Start up the thread. We do not bother keeping a reference to it
|
||||
because it runs until program termination. From here on out all reads
|
||||
from the stdin handle or file descriptor 0 will be reading from the
|
||||
socket that is fed by the thread. */
|
||||
|
||||
@ -1213,7 +1213,7 @@ static ParameterError parse_ech(struct OperationConfig *config,
|
||||
file = curlx_fopen(nextarg, FOPEN_READTEXT);
|
||||
}
|
||||
if(!file) {
|
||||
warnf("Couldn't read file \"%s\" "
|
||||
warnf("Could not read file \"%s\" "
|
||||
"specified for \"--ech ecl:\" option",
|
||||
nextarg);
|
||||
return PARAM_BAD_USE; /* */
|
||||
@ -2084,7 +2084,7 @@ static ParameterError opt_bool(struct OperationConfig *config,
|
||||
config->doh_insecure_ok = toggle;
|
||||
break;
|
||||
case C_LIST_ONLY: /* --list-only */
|
||||
config->dirlistonly = toggle; /* only list the names of the FTP dir */
|
||||
config->dirlistonly = toggle; /* only list names of the FTP directory */
|
||||
break;
|
||||
case C_MANUAL: /* --manual */
|
||||
if(toggle) /* --no-manual shows no manual... */
|
||||
@ -2876,7 +2876,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
/* is there an '=' ? */
|
||||
if(!curlx_str_until(&p, &out, MAX_OPTION_LEN, '=') &&
|
||||
!curlx_str_single(&p, '=') ) {
|
||||
/* there's an equal sign */
|
||||
/* there is an equal sign */
|
||||
char tempword[MAX_OPTION_LEN + 1];
|
||||
memcpy(tempword, curlx_str(&out), curlx_strlen(&out));
|
||||
tempword[curlx_strlen(&out)] = 0;
|
||||
|
||||
@ -2252,7 +2252,7 @@ CURLcode operate(int argc, argv_item_t argv[])
|
||||
strcmp(first_arg, "--disable"))) {
|
||||
parseconfig(NULL, CONFIG_MAX_LEVELS); /* ignore possible failure */
|
||||
|
||||
/* If we had no arguments then make sure a url was specified in .curlrc */
|
||||
/* If we had no arguments then make sure a URL was specified in .curlrc */
|
||||
if((argc < 2) && (!global->first->url_list)) {
|
||||
helpf(NULL);
|
||||
result = CURLE_FAILED_INIT;
|
||||
|
||||
@ -211,7 +211,7 @@ CURLcode get_url_file_name(char **filename, const char *url)
|
||||
else {
|
||||
/* no slash => empty string, use default */
|
||||
*filename = strdup("curl_response");
|
||||
warnf("No remote file name, uses \"%s\"", *filename);
|
||||
warnf("No remote filename, uses \"%s\"", *filename);
|
||||
}
|
||||
|
||||
curl_free(path);
|
||||
|
||||
@ -135,7 +135,7 @@ ParameterError file2memory_range(char **bufp, size_t *size, FILE *file,
|
||||
offset = starto;
|
||||
}
|
||||
else
|
||||
/* we can't seek stdin, read 'starto' bytes and throw them away */
|
||||
/* we cannot seek stdin, read 'starto' bytes and throw them away */
|
||||
throwaway = starto;
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +103,7 @@ ParameterError parseconfig(const char *filename, int max_recursive)
|
||||
#if defined(_WIN32) && !defined(UNDER_CE)
|
||||
else {
|
||||
char *fullp;
|
||||
/* check for .curlrc then _curlrc in the dir of the executable */
|
||||
/* check for .curlrc then _curlrc in the directory of the executable */
|
||||
file = tool_execpath(".curlrc", &fullp);
|
||||
if(!file)
|
||||
file = tool_execpath("_curlrc", &fullp);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user