Skip to content

Commit

Permalink
tidy-up: mostly whitespace nits
Browse files Browse the repository at this point in the history
- delete completed TODO from `./CMakeLists.txt`.
- convert a C++ comment to C89 in `./CMake/CurlTests.c`.
- delete duplicate EOLs from EOF.
- add missing EOL at EOF.
- delete whitespace at EOL (except from expected test results).
- convert tabs to spaces.
- convert CRLF EOLs to LF in GHA yaml.
- text casing fixes in `./CMakeLists.txt`.
- fix a codespell typo in `packages/OS400/initscript.sh`.

Closes curl#11772
  • Loading branch information
vszakats committed Aug 31, 2023
1 parent 63f23fa commit ce3dce9
Show file tree
Hide file tree
Showing 87 changed files with 135 additions and 173 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ body:
id: expected-behaviour
attributes:
label: I expected the following
validations:
validations:
required: false

- type: textarea
id: version
attributes:
Expand Down
1 change: 0 additions & 1 deletion .github/scripts/cleanspell.pl
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@
}
close(F);
close(O);

82 changes: 41 additions & 41 deletions .github/workflows/appveyor-status.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# SPDX-License-Identifier: curl

name: AppVeyor Status Report

on:
status

concurrency:
group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}
cancel-in-progress: true

permissions: {}

jobs:
split:
runs-on: ubuntu-latest
if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions:
statuses: write
steps:
- name: Create individual AppVeyor build statuses
if: ${{ github.event.sha && github.event.target_url }}
env:
APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo ${APPVEYOR_TARGET_URL} | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending")
| sub("starting"; "pending")
| sub("running"; "pending")
| sub("failed"; "failure")
| sub("cancelled"; "error")),
description: .status}' \
--arg target_url ${APPVEYOR_TARGET_URL} | tee /dev/stderr | parallel --pipe -j 1 -N 1 \
gh api --silent --input - repos/${APPVEYOR_REPOSITORY}/statuses/${APPVEYOR_COMMIT_SHA}
# Copyright (C) Daniel Stenberg, <[email protected]>, et al.
#
# SPDX-License-Identifier: curl

name: AppVeyor Status Report

on:
status

concurrency:
group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}
cancel-in-progress: true

permissions: {}

jobs:
split:
runs-on: ubuntu-latest
if: ${{ github.event.sender.login == 'appveyor[bot]' }}
permissions:
statuses: write
steps:
- name: Create individual AppVeyor build statuses
if: ${{ github.event.sha && github.event.target_url }}
env:
APPVEYOR_COMMIT_SHA: ${{ github.event.sha }}
APPVEYOR_TARGET_URL: ${{ github.event.target_url }}
APPVEYOR_REPOSITORY: ${{ github.event.repository.full_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo ${APPVEYOR_TARGET_URL} | sed 's/\/project\//\/api\/projects\//' | xargs -t -n1 curl -s | \
jq -c '.build.jobs[] | {target_url: ($target_url + "/job/" + .jobId),
context: (.name | sub("^(Environment: )?"; "AppVeyor / ")),
state: (.status | sub("queued"; "pending")
| sub("starting"; "pending")
| sub("running"; "pending")
| sub("failed"; "failure")
| sub("cancelled"; "error")),
description: .status}' \
--arg target_url ${APPVEYOR_TARGET_URL} | tee /dev/stderr | parallel --pipe -j 1 -N 1 \
gh api --silent --input - repos/${APPVEYOR_REPOSITORY}/statuses/${APPVEYOR_COMMIT_SHA}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ curl_fuzzer_seed_corpus.zip
libstandaloneengine.a
tests/string
tests/config

2 changes: 1 addition & 1 deletion CMake/CurlTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ main() {
int
main() {
_Atomic int i = 1;
i = 0; // Force an atomic-write operation.
i = 0; /* Force an atomic-write operation. */
return i;
}
#endif
Expand Down
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -391,21 +391,20 @@ if(WIN32)
endif()

# check SSL libraries
# TODO support GnuTLS
option(CURL_ENABLE_SSL "Enable SSL support" ON)

if(APPLE)
cmake_dependent_option(CURL_USE_SECTRANSP "enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_SECTRANSP "Enable Apple OS native SSL/TLS" OFF CURL_ENABLE_SSL OFF)
endif()
if(WIN32)
cmake_dependent_option(CURL_USE_SCHANNEL "enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_SCHANNEL "Enable Windows native SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_WINDOWS_SSPI "Use windows libraries to allow NTLM authentication without OpenSSL" ON
CURL_USE_SCHANNEL OFF)
endif()
cmake_dependent_option(CURL_USE_MBEDTLS "Enable mbedTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_BEARSSL "Enable BearSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_WOLFSSL "enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_GNUTLS "Enable GNUTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_WOLFSSL "Enable wolfSSL for SSL/TLS" OFF CURL_ENABLE_SSL OFF)
cmake_dependent_option(CURL_USE_GNUTLS "Enable GNUTLS for SSL/TLS" OFF CURL_ENABLE_SSL OFF)

set(openssl_default ON)
if(WIN32 OR CURL_USE_SECTRANSP OR CURL_USE_SCHANNEL OR CURL_USE_MBEDTLS OR CURL_USE_WOLFSSL)
Expand Down Expand Up @@ -607,7 +606,7 @@ if(USE_OPENSSL OR USE_WOLFSSL)
endif()
endif()

option(USE_NGHTTP2 "Use Nghttp2 library" OFF)
option(USE_NGHTTP2 "Use nghttp2 library" OFF)
if(USE_NGHTTP2)
find_package(NGHTTP2 REQUIRED)
include_directories(${NGHTTP2_INCLUDE_DIRS})
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/
## Sponsors

Support this project by becoming a [sponsor](https://curl.se/sponsors.html).

11 changes: 4 additions & 7 deletions docs/BUFQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ To pass data into a `bufq` without an extra copy, read callbacks can be used.
typedef ssize_t Curl_bufq_reader(void *reader_ctx, unsigned char *buf, size_t len,
CURLcode *err);
ssize_t Curl_bufq_slurp(struct bufq *q, Curl_bufq_reader *reader, void *reader_ctx,
ssize_t Curl_bufq_slurp(struct bufq *q, Curl_bufq_reader *reader, void *reader_ctx,
CURLcode *err);
```

`Curl_bufq_slurp()` will invoke the given `reader` callback, passing it its own internal
Expand All @@ -44,7 +43,7 @@ The analog mechanism for write out buffer data is:
typedef ssize_t Curl_bufq_writer(void *writer_ctx, const unsigned char *buf, size_t len,
CURLcode *err);
ssize_t Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, void *writer_ctx,
ssize_t Curl_bufq_pass(struct bufq *q, Curl_bufq_writer *writer, void *writer_ctx,
CURLcode *err);
```

Expand Down Expand Up @@ -106,10 +105,10 @@ If a `bufq` is created with a `bufc_pool`, the no longer used chunks are returne

## empty, full and overflow

One can ask about the state of a `bufq` with methods such as `Curl_bufq_is_empty(q)`,
One can ask about the state of a `bufq` with methods such as `Curl_bufq_is_empty(q)`,
`Curl_bufq_is_full(q)`, etc. The amount of data held by a `bufq` is the sum of the data in all its chunks. This is what is reported by `Curl_bufq_len(q)`.

Note that a `bufq` length and it being "full" are only loosely related. A simple example:
Note that a `bufq` length and it being "full" are only loosely related. A simple example:

* create a `bufq` with chunk_size=1000 and max_chunks=4.
* write 4000 bytes to it, it will report "full"
Expand Down Expand Up @@ -140,5 +139,3 @@ A pool can be shared between many `bufq`s, as long as all of them operate in the

* when all `bufq`s are empty, only memory for `max_spare` chunks in the pool is used. Empty `bufq`s will hold no memory.
* the latest spare chunk is the first to be handed out again, no matter which `bufq` needs it. This keeps the footprint of "recently used" memory smaller.


2 changes: 1 addition & 1 deletion docs/BUGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

## Not reproducible

We may require further work from you who actually see or experience the
We may require further work from you who actually see or experience the
problem if we cannot reproduce it and cannot understand it even after having
gotten all the info we need and having studied the source code over again.

Expand Down
12 changes: 6 additions & 6 deletions docs/CONNECTION-FILTERS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# curl connection filters

Connection filters is a design in the internals of curl, not visible in its public API. They were added
Connection filters is a design in the internals of curl, not visible in its public API. They were added
in curl v7.xx.x. This document describes the concepts, its high level implementation and the motivations.

## Filters
Expand Down Expand Up @@ -34,13 +34,13 @@ Direct:
http://localhost/ conn -> cf-socket
https://curl.se/ conn -> cf-ssl -> cf-socket
Via http proxy tunnel:
http://localhost/ conn -> cf-http-proxy -> cf-socket
http://localhost/ conn -> cf-http-proxy -> cf-socket
https://curl.se/ conn -> cf-ssl -> cf-http-proxy -> cf-socket
Via https proxy tunnel:
http://localhost/ conn -> cf-http-proxy -> cf-ssl -> cf-socket
http://localhost/ conn -> cf-http-proxy -> cf-ssl -> cf-socket
https://curl.se/ conn -> cf-ssl -> cf-http-proxy -> cf-ssl -> cf-socket
Via http proxy tunnel via SOCKS proxy:
http://localhost/ conn -> cf-http-proxy -> cf-socks -> cf-socket
http://localhost/ conn -> cf-http-proxy -> cf-socks -> cf-socket
```

### Connecting/Closing
Expand All @@ -50,7 +50,7 @@ Before `Curl_easy` can send the request, the connection needs to be established.
Each filter does in principle the following:

```
static CURLcode
static CURLcode
myfilter_cf_connect(struct Curl_cfilter *cf,
struct Curl_easy *data,
bool *done)
Expand All @@ -63,7 +63,7 @@ myfilter_cf_connect(struct Curl_cfilter *cf,
}
/* Let the filters below connect */
result = cf->next->cft->connect(cf->next, data, blocking, done);
if(result || !*done)
if(result || !*done)
return result; /* below errored/not finished yet */
/* MYFILTER CONNECT THINGS */ /* below connected, do out thing */
Expand Down
1 change: 0 additions & 1 deletion docs/DEPRECATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ curl will remove the support for space-separated names in July 2024.
- Support for systems without 64 bit data types
- NSS
- gskit

2 changes: 1 addition & 1 deletion docs/HTTP3.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ should be either in your PATH or your current directory.
Create a `Caddyfile` with the following content:
~~~
localhost:7443 {
respond "Hello, world! you are using {http.request.proto}"
respond "Hello, world! you are using {http.request.proto}"
}
~~~

Expand Down
1 change: 0 additions & 1 deletion docs/HYPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,3 @@ still need attention and verification include:
- h2 Upgrade:
- receiving HTTP/1 trailers
- sending HTTP/1 trailers

2 changes: 1 addition & 1 deletion docs/cmdline-opts/max-filesize.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ gigabytes. Examples: 200K, 3m and 1G. (Added in 7.58.0)

**NOTE**: The file size is not always known prior to download, and for such
files this option has no effect even if the file transfer ends up being larger
than this given limit.
than this given limit.
1 change: 0 additions & 1 deletion docs/cmdline-opts/variable.d
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ shows the content URL (percent) encoded.
expands the variable base64 encoded
.RE
.IP

1 change: 0 additions & 1 deletion docs/examples/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ int main(void)
#endif
return 0;
}

1 change: 0 additions & 1 deletion docs/libcurl/libcurl-ws.3
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ change API, ABI and behavior before this "goes live".
.BR curl_ws_meta "(3), " curl_ws_recv "(3), " curl_ws_send "(3), "
.BR curl_easy_init "(3), " CURLOPT_CONNECT_ONLY "(3), "
.BR CURLOPT_WRITEFUNCTION "(3)" CURLOPT_WS_OPTIONS "(3), "

1 change: 0 additions & 1 deletion docs/libcurl/opts/CURLOPT_HSTSREADFUNCTION.3
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ This returns CURLE_OK.
.SH "SEE ALSO"
.BR CURLOPT_HSTSREADDATA "(3), " CURLOPT_HSTSWRITEFUNCTION "(3), "
.BR CURLOPT_HSTS "(3), " CURLOPT_HSTS_CTRL "(3), "

1 change: 0 additions & 1 deletion docs/libcurl/opts/CURLOPT_UPKEEP_INTERVAL_MS.3
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,3 @@ Added in 7.62.0
Returns CURLE_OK
.SH SEE ALSO
.BR CURLOPT_TCP_KEEPALIVE "(3), "

2 changes: 1 addition & 1 deletion docs/libcurl/opts/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ man_MANS = \
CURLOPT_SSL_CIPHER_LIST.3 \
CURLOPT_SSL_CTX_DATA.3 \
CURLOPT_SSL_CTX_FUNCTION.3 \
CURLOPT_SSL_EC_CURVES.3 \
CURLOPT_SSL_EC_CURVES.3 \
CURLOPT_SSL_ENABLE_ALPN.3 \
CURLOPT_SSL_ENABLE_NPN.3 \
CURLOPT_SSL_FALSESTART.3 \
Expand Down
1 change: 0 additions & 1 deletion lib/amigaos.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ void Curl_amiga_cleanup(void);
#endif

#endif /* HEADER_CURL_AMIGAOS_H */

1 change: 0 additions & 1 deletion lib/cfilters.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,4 +646,3 @@ size_t Curl_conn_get_max_concurrent(struct Curl_easy *data,
&n, NULL) : CURLE_UNKNOWN_OPTION;
return (result || n <= 0)? 1 : (size_t)n;
}

1 change: 0 additions & 1 deletion lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,4 +1446,3 @@ CURLcode Curl_conn_setup(struct Curl_easy *data,
out:
return result;
}

1 change: 0 additions & 1 deletion lib/sendf.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,4 +421,3 @@ CURLcode Curl_read(struct Curl_easy *data, /* transfer */
out:
return result;
}

2 changes: 1 addition & 1 deletion m4/curl-bearssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if test "x$OPT_BEARSSL" != xno; then
BEARSSL_ENABLED=1
USE_BEARSSL="yes"
ssl_msg="BearSSL"
test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
], [], -lbearssl)
fi
Expand Down
2 changes: 1 addition & 1 deletion m4/curl-mbedtls.m4
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if test "x$OPT_MBEDTLS" != xno; then
MBEDTLS_ENABLED=1
USE_MBEDTLS="yes"
ssl_msg="mbedTLS"
test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
], [], -lmbedx509 -lmbedcrypto)
fi
Expand Down
2 changes: 1 addition & 1 deletion m4/curl-openssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ if test "x$OPT_OPENSSL" != xno; then
AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
openssl/pem.h openssl/ssl.h openssl/err.h,
ssl_msg="OpenSSL"
test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
OPENSSL_ENABLED=1
AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
Expand Down
2 changes: 1 addition & 1 deletion m4/curl-rustls.m4
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if test "x$OPT_RUSTLS" != xno; then
RUSTLS_ENABLED=1
USE_RUSTLS="yes"
ssl_msg="rustls"
test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
], [], -lpthread -ldl -lm)
fi
Expand Down
10 changes: 5 additions & 5 deletions m4/curl-wolfssl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -90,24 +90,24 @@ if test "x$OPT_WOLFSSL" != xno; then
AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
AC_LANG_PROGRAM([[
/* These aren't needed for detection and confuse WolfSSL.
They are set up properly later if it is detected. */
#undef SIZEOF_LONG
#undef SIZEOF_LONG_LONG
#include <wolfssl/options.h>
#include <wolfssl/ssl.h>
]],[[
return wolfSSL_Init();
]])
]],[[
return wolfSSL_Init();
]])
],[
AC_MSG_RESULT(yes)
AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
AC_SUBST(USE_WOLFSSL, [1])
WOLFSSL_ENABLED=1
USE_WOLFSSL="yes"
ssl_msg="WolfSSL"
test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
],
[
AC_MSG_RESULT(no)
Expand Down
2 changes: 1 addition & 1 deletion packages/OS400/initscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ versioned_copy()
# The `sed' statement works as follows:
# - Join \nl-separated lines.
# - Retain only lines that begins with "identifier =".
# - Replace @...@ sustitutions by shell variable references.
# - Replace @...@ substitutions by shell variable references.
# - Turn these lines into shell variable assignments.

get_make_vars()
Expand Down
Loading

0 comments on commit ce3dce9

Please sign in to comment.