From ac6264366fbe6ff0cc4fe9f30364285ffefb8043 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 2 Jan 2026 01:34:05 +0100 Subject: [PATCH] tidy-up: miscellaneous - tool_bname: scope an include. - `endif` comments. - Markdown fixes. - comment tidy-ups. - whitespace, newlines, indent. Closes #20309 --- .github/workflows/http3-linux.yml | 2 +- .github/workflows/linux-old.yml | 2 +- .github/workflows/macos.yml | 4 +- .github/workflows/non-native.yml | 4 +- Makefile.am | 74 +++---- docs/CONTRIBUTE.md | 31 +-- docs/HELP-US.md | 12 +- docs/HSTS.md | 14 +- docs/HTTP3.md | 4 +- docs/INSTALL-CMAKE.md | 12 +- docs/INSTALL.md | 189 ++++++++-------- docs/INTERNALS.md | 81 ++++--- docs/KNOWN_BUGS.md | 6 +- docs/KNOWN_RISKS.md | 12 +- docs/MANUAL.md | 28 +-- docs/Makefile.am | 170 +++++++------- docs/TODO.md | 2 +- docs/URL-SYNTAX.md | 20 +- docs/VULN-DISCLOSURE-POLICY.md | 12 +- docs/examples/htmltitle.cpp | 32 +-- docs/internals/CONNECTION-FILTERS.md | 15 +- docs/internals/MQTT.md | 9 +- docs/internals/WEBSOCKET.md | 14 +- docs/libcurl/Makefile.inc | 208 +++++++++--------- docs/libcurl/curl_formget.md | 4 +- docs/libcurl/curl_multi_info_read.md | 16 +- docs/libcurl/libcurl-multi.md | 6 +- .../opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md | 2 +- docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md | 2 +- docs/runtests.md | 2 +- docs/testcurl.md | 2 +- docs/tests/CI.md | 32 +-- docs/tests/FILEFORMAT.md | 16 +- include/curl/Makefile.am | 2 +- lib/Makefile.am | 3 +- lib/curl_range.c | 6 +- lib/curl_sasl.c | 6 +- lib/curl_sha512_256.c | 6 +- lib/curlx/fopen.h | 10 +- lib/easy.c | 2 +- lib/formdata.c | 3 +- lib/memdebug.c | 1 + lib/mime.c | 16 +- lib/mime.h | 3 +- lib/multi.c | 31 ++- lib/multi_ev.c | 3 +- lib/multi_ntfy.c | 3 +- lib/pop3.c | 10 +- lib/progress.c | 11 +- lib/ratelimit.h | 6 +- lib/strerror.c | 2 - lib/url.h | 2 +- lib/vauth/cram.c | 1 - lib/vauth/vauth.c | 8 - lib/vtls/schannel.c | 14 +- m4/curl-confopts.m4 | 2 +- projects/README.md | 8 +- projects/Windows/README.md | 24 +- projects/vms/Makefile.am | 70 +++--- projects/vms/gnv_curl_configure.sh | 6 +- scripts/checksrc-all.pl | 6 +- scripts/contributors.sh | 20 +- scripts/managen | 3 +- scripts/mk-ca-bundle.pl | 16 +- src/config2setopts.c | 2 +- src/tool_bname.c | 4 +- src/tool_cb_hdr.c | 2 +- src/tool_cb_prg.c | 2 +- src/tool_cb_rea.c | 2 +- src/tool_cb_see.h | 1 - src/tool_cb_wrt.c | 4 +- src/tool_cfgable.c | 2 +- src/tool_cfgable.h | 2 +- src/tool_findfile.c | 2 +- src/tool_getparam.c | 4 +- src/tool_getpass.c | 9 +- src/tool_help.h | 4 +- src/tool_libinfo.c | 2 +- src/tool_main.c | 2 +- src/tool_progress.h | 1 - src/tool_sdecls.h | 6 +- tests/Makefile.am | 116 +++++----- tests/data/test1292 | 2 +- tests/data/test16 | 2 +- tests/data/test1630 | 2 +- tests/data/test2 | 2 +- tests/data/test218 | 2 +- tests/data/test3 | 2 +- tests/data/test571 | 6 +- tests/data/test97 | 2 +- tests/data/test98 | 2 +- tests/getpart.pm | 5 +- tests/http/Makefile.am | 94 ++++---- tests/libtest/lib562.c | 7 +- tests/server/tftpd.c | 4 +- tests/unit/unit1609.c | 44 ++-- tests/unit/unit3211.c | 3 +- tests/unit/unit3213.c | 3 +- 98 files changed, 829 insertions(+), 863 deletions(-) diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index 15a4c4457e..b6b9359d57 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -339,7 +339,7 @@ jobs: name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }} needs: - build-cache - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest timeout-minutes: 10 env: MATRIX_BUILD: ${{ matrix.build.generate && 'cmake' || 'autotools' }} diff --git a/.github/workflows/linux-old.yml b/.github/workflows/linux-old.yml index 92cfae80f0..08d1d039b9 100644 --- a/.github/workflows/linux-old.yml +++ b/.github/workflows/linux-old.yml @@ -54,7 +54,7 @@ env: jobs: cmake-autotools: name: 'autotools & cmake' - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest container: 'debian:stretch' env: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e9ff3f37f1..09305fe3ea 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -47,7 +47,7 @@ env: jobs: ios: name: "iOS, ${{ (matrix.build.generator && format('CM-{0}', matrix.build.generator)) || (matrix.build.generate && 'CM' || 'AM' )}} ${{ matrix.build.name }} arm64" - runs-on: 'macos-latest' + runs-on: macos-latest timeout-minutes: 10 env: DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" @@ -202,7 +202,7 @@ jobs: macos: name: "${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.compiler }} ${{ matrix.build.name }}" - runs-on: 'macos-15' + runs-on: macos-15 timeout-minutes: 15 env: DEVELOPER_DIR: "/Applications/Xcode${{ matrix.build.xcode && format('_{0}', matrix.build.xcode) || '' }}.app/Contents/Developer" diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index b617493e2c..6c0bae1dc4 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -237,7 +237,7 @@ jobs: android: name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64" - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest timeout-minutes: 5 env: MAKEFLAGS: -j 5 @@ -328,7 +328,7 @@ jobs: msdos: name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586" - runs-on: 'ubuntu-latest' + runs-on: ubuntu-latest timeout-minutes: 5 env: MAKEFLAGS: -j 5 diff --git a/Makefile.am b/Makefile.am index d04c079ba1..605215060b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,43 +26,43 @@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 -CMAKE_DIST = \ - CMake/cmake_uninstall.in.cmake \ - CMake/curl-config.in.cmake \ - CMake/CurlSymbolHiding.cmake \ - CMake/CurlTests.c \ - CMake/FindBrotli.cmake \ - CMake/FindCares.cmake \ - CMake/FindGnuTLS.cmake \ - CMake/FindGSS.cmake \ - CMake/FindLDAP.cmake \ - CMake/FindLibbacktrace.cmake \ - CMake/FindLibgsasl.cmake \ - CMake/FindLibidn2.cmake \ - CMake/FindLibpsl.cmake \ - CMake/FindLibrtmp.cmake \ - CMake/FindLibssh.cmake \ - CMake/FindLibssh2.cmake \ - CMake/FindLibuv.cmake \ - CMake/FindMbedTLS.cmake \ - CMake/FindNGHTTP2.cmake \ - CMake/FindNGHTTP3.cmake \ - CMake/FindNGTCP2.cmake \ - CMake/FindNettle.cmake \ - CMake/FindQuiche.cmake \ - CMake/FindRustls.cmake \ - CMake/FindWolfSSL.cmake \ - CMake/FindZstd.cmake \ - CMake/Macros.cmake \ - CMake/OtherTests.cmake \ - CMake/PickyWarnings.cmake \ - CMake/Utilities.cmake \ - CMake/unix-cache.cmake \ - CMake/win32-cache.cmake \ - CMakeLists.txt \ - tests/cmake/CMakeLists.txt \ - tests/cmake/test.c \ - tests/cmake/test.sh +CMAKE_DIST = \ + CMake/cmake_uninstall.in.cmake \ + CMake/curl-config.in.cmake \ + CMake/CurlSymbolHiding.cmake \ + CMake/CurlTests.c \ + CMake/FindBrotli.cmake \ + CMake/FindCares.cmake \ + CMake/FindGnuTLS.cmake \ + CMake/FindGSS.cmake \ + CMake/FindLDAP.cmake \ + CMake/FindLibbacktrace.cmake \ + CMake/FindLibgsasl.cmake \ + CMake/FindLibidn2.cmake \ + CMake/FindLibpsl.cmake \ + CMake/FindLibrtmp.cmake \ + CMake/FindLibssh.cmake \ + CMake/FindLibssh2.cmake \ + CMake/FindLibuv.cmake \ + CMake/FindMbedTLS.cmake \ + CMake/FindNGHTTP2.cmake \ + CMake/FindNGHTTP3.cmake \ + CMake/FindNGTCP2.cmake \ + CMake/FindNettle.cmake \ + CMake/FindQuiche.cmake \ + CMake/FindRustls.cmake \ + CMake/FindWolfSSL.cmake \ + CMake/FindZstd.cmake \ + CMake/Macros.cmake \ + CMake/OtherTests.cmake \ + CMake/PickyWarnings.cmake \ + CMake/Utilities.cmake \ + CMake/unix-cache.cmake \ + CMake/win32-cache.cmake \ + CMakeLists.txt \ + tests/cmake/CMakeLists.txt \ + tests/cmake/test.c \ + tests/cmake/test.sh EXTRA_DIST = CHANGES.md COPYING RELEASE-NOTES Dockerfile .editorconfig $(CMAKE_DIST) diff --git a/docs/CONTRIBUTE.md b/docs/CONTRIBUTE.md index 3abf729598..093244f2f5 100644 --- a/docs/CONTRIBUTE.md +++ b/docs/CONTRIBUTE.md @@ -224,9 +224,9 @@ How to write git commit messages in the curl project. The first line is a succinct description of the change and should ideally work as a single line in the RELEASE NOTES. - - use the imperative, present tense: **change** not "changed" nor "changes" - - do not capitalize the first letter - - no period (.) at the end +- use the imperative, present tense: **change** not "changed" nor "changes" +- do not capitalize the first letter +- no period (.) at the end The `[area]` in the first line can be `http2`, `cookies`, `openssl` or similar. There is no fixed list to select from but using the same "area" as @@ -238,36 +238,36 @@ Use the following ways to improve the message and provide pointers to related work. - `Follow-up to {shorthash}` - if this fixes or continues a previous commit; -add a `Ref:` that commit's PR or issue if it is not a small, obvious fix; -followed by an empty line + add a `Ref:` that commit's PR or issue if it is not a small, obvious fix; + followed by an empty line - `Bug: URL` to the source of the report or more related discussion; use -`Fixes` for GitHub issues instead when that is appropriate. + `Fixes` for GitHub issues instead when that is appropriate. - `Approved-by: John Doe` - credit someone who approved the PR. - `Authored-by: John Doe` - credit the original author of the code; only use -this if you cannot use `git commit --author=...`. + this if you cannot use `git commit --author=...`. - `Signed-off-by: John Doe` - we do not use this, but do not bother removing it. - `whatever-else-by:` credit all helpers, finders, doers; try to use one of -the following keywords if at all possible, for consistency: `Acked-by:`, -`Assisted-by:`, `Co-authored-by:`, `Found-by:`, `Reported-by:`, -`Reviewed-by:`, `Suggested-by:`, `Tested-by:`. + the following keywords if at all possible, for consistency: `Acked-by:`, + `Assisted-by:`, `Co-authored-by:`, `Found-by:`, `Reported-by:`, + `Reviewed-by:`, `Suggested-by:`, `Tested-by:`. - `Ref: #1234` - if this is related to a GitHub issue or PR, possibly one that -has already been closed. + has already been closed. - `Ref: URL` to more information about the commit; use `Bug:` instead for a -reference to a bug on another bug tracker] + reference to a bug on another bug tracker] - `Fixes #1234` - if this fixes a GitHub issue; GitHub closes the issue once -this commit is merged. + this commit is merged. - `Closes #1234` - if this merges a GitHub PR; GitHub closes the PR once this -commit is merged. + commit is merged. Do not forget to use commit with `--author` if you commit someone else's work, and make sure that you have your own user and email setup correctly in git @@ -289,7 +289,8 @@ Just ask if this is what you would want. You are required to have posted several high quality patches first, before you can be granted push access. ## Useful resources - - [Webinar on getting code into curl](https://youtu.be/QmZ3W1d6LQI) + +- [Webinar on getting code into curl](https://youtu.be/QmZ3W1d6LQI) # Update copyright and license information diff --git a/docs/HELP-US.md b/docs/HELP-US.md index 0619aec531..e676dcf08f 100644 --- a/docs/HELP-US.md +++ b/docs/HELP-US.md @@ -33,12 +33,12 @@ If you are looking for a smaller or simpler task in the project to help out with as an entry-point into the project, perhaps because you are a newcomer or even maybe not a terribly experienced developer, here's our advice: - - Read through this document to get a grasp on a general approach to use - - Consider adding a test case for something not currently tested (correctly) - - Consider updating or adding documentation - - One way to get started gently in the project, is to participate in an - existing issue/PR and help out by reproducing the issue, review the code in - the PR etc. +- Read through this document to get a grasp on a general approach to use +- Consider adding a test case for something not currently tested (correctly) +- Consider updating or adding documentation +- One way to get started gently in the project, is to participate in an + existing issue/PR and help out by reproducing the issue, review the code in + the PR etc. ## Help wanted diff --git a/docs/HSTS.md b/docs/HSTS.md index 33948bb3e6..8d311c8e47 100644 --- a/docs/HSTS.md +++ b/docs/HSTS.md @@ -21,14 +21,14 @@ HTTP-only requests to a hostname present in the cache gets internally ## `curl_easy_setopt()` options: - - `CURLOPT_HSTS_CTRL` - enable HSTS for this easy handle - - `CURLOPT_HSTS` - specify filename where to store the HSTS cache on close - (and possibly read from at startup) +- `CURLOPT_HSTS_CTRL` - enable HSTS for this easy handle +- `CURLOPT_HSTS` - specify filename where to store the HSTS cache on close + (and possibly read from at startup) ## curl command line options - - `--hsts [filename]` - enable HSTS, use the file as HSTS cache. If filename - is `""` (no length) then no file is used, only in-memory cache. +- `--hsts [filename]` - enable HSTS, use the file as HSTS cache. If filename + is `""` (no length) then no file is used, only in-memory cache. ## HSTS cache file format @@ -44,5 +44,5 @@ The time stamp is when the entry expires. ## Possible future additions - - `CURLOPT_HSTS_PRELOAD` - provide a set of HSTS hostnames to load first - - ability to save to something else than a file +- `CURLOPT_HSTS_PRELOAD` - provide a set of HSTS hostnames to load first +- ability to save to something else than a file diff --git a/docs/HTTP3.md b/docs/HTTP3.md index e18277cb3c..59fba0e5ce 100644 --- a/docs/HTTP3.md +++ b/docs/HTTP3.md @@ -33,8 +33,8 @@ master branch using pull-requests, just like ordinary changes. To fix before we remove the experimental label: - - the used QUIC library needs to consider itself non-beta - - it is fine to "leave" individual backends as experimental if necessary +- the used QUIC library needs to consider itself non-beta +- it is fine to "leave" individual backends as experimental if necessary # ngtcp2 version diff --git a/docs/INSTALL-CMAKE.md b/docs/INSTALL-CMAKE.md index dd7b7f3f97..0023adb27f 100644 --- a/docs/INSTALL-CMAKE.md +++ b/docs/INSTALL-CMAKE.md @@ -30,15 +30,15 @@ from the `projects/Windows` Visual Studio solution files, see You can configure for in source tree builds or for a build tree that is apart from the source tree. - - Build in the source tree. +- Build in the source tree. - $ cmake -B . + $ cmake -B . - - Build in a separate directory (parallel to the curl source tree in this - example). The build directory is created for you. This is recommended over - building in the source tree to separate source and build artifacts. +- Build in a separate directory (parallel to the curl source tree in this + example). The build directory is created for you. This is recommended over + building in the source tree to separate source and build artifacts. - $ cmake -B ../curl-build + $ cmake -B ../curl-build For the full list of CMake build configuration variables see [the corresponding section](#cmake-build-options). diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 96b3539284..17dd78a740 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -137,13 +137,13 @@ alter it, you can select how to deal with each individual library. These options are provided to select the TLS backend to use. - - AmiSSL: `--with-amissl` - - GnuTLS: `--with-gnutls`. - - mbedTLS: `--with-mbedtls` - - OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls) - - Rustls: `--with-rustls` - - Schannel: `--with-schannel` - - wolfSSL: `--with-wolfssl` +- AmiSSL: `--with-amissl` +- GnuTLS: `--with-gnutls`. +- mbedTLS: `--with-mbedtls` +- OpenSSL: `--with-openssl` (also for BoringSSL, AWS-LC, LibreSSL, and quictls) +- Rustls: `--with-rustls` +- Schannel: `--with-schannel` +- wolfSSL: `--with-wolfssl` You can build curl with *multiple* TLS backends at your choice, but some TLS backends cannot be combined: if you build with an OpenSSL fork (or wolfSSL), @@ -161,16 +161,16 @@ start somewhere. Those "root" certificates make the set of Trust Anchors. While the build system tries to find good defaults on the platform you use, you may specify these explicitly. The following options are provided: - - `--with-ca-bundle=FILE`: the file that libcurl loads default root - certificates from. - - `--with-ca-path=DIRECTORY`: a directory in which root certificates files - are found. - - `--with-ca-embed=FILE`: a file read *at build time* and added to `libcurl`. - - `--with-ca-fallback`: an OpenSSL specific option for delegating default - trust anchor selection to what OpenSSL thinks is best, *if* there are -no other certificates configured by the application. - - `--with-apple-sectrust`: use the system "SecTrust" service on Apple - operating systems for verification. (Added in 8.17.0) +- `--with-ca-bundle=FILE`: the file that libcurl loads default root + certificates from. +- `--with-ca-path=DIRECTORY`: a directory in which root certificates files + are found. +- `--with-ca-embed=FILE`: a file read *at build time* and added to `libcurl`. +- `--with-ca-fallback`: an OpenSSL specific option for delegating default + trust anchor selection to what OpenSSL thinks is best, *if* there are + no other certificates configured by the application. +- `--with-apple-sectrust`: use the system "SecTrust" service on Apple + operating systems for verification. (Added in 8.17.0) ## MultiSSL and HTTP/3 @@ -205,24 +205,24 @@ You can build curl with: ## Building Windows DLLs and C runtime (CRT) linkage issues - As a general rule, building a DLL with static CRT linkage is highly - discouraged, and intermixing CRTs in the same app is something to avoid at - any cost. +As a general rule, building a DLL with static CRT linkage is highly +discouraged, and intermixing CRTs in the same app is something to avoid at +any cost. - Reading and comprehending Microsoft Knowledge Base articles KB94248 and - KB140584 is a must for any Windows developer. Especially important is full - understanding if you are not going to follow the advice given above. +Reading and comprehending Microsoft Knowledge Base articles KB94248 and +KB140584 is a must for any Windows developer. Especially important is full +understanding if you are not going to follow the advice given above. - - [How To Use the C Runtime](https://learn.microsoft.com/troubleshoot/developer/visualstudio/cpp/libraries/use-c-run-time) - - [Runtime Library Compiler Options](https://learn.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library) - - [Potential Errors Passing CRT Objects Across DLL Boundaries](https://learn.microsoft.com/cpp/c-runtime-library/potential-errors-passing-crt-objects-across-dll-boundaries) +- [How To Use the C Runtime](https://learn.microsoft.com/troubleshoot/developer/visualstudio/cpp/libraries/use-c-run-time) +- [Runtime Library Compiler Options](https://learn.microsoft.com/cpp/build/reference/md-mt-ld-use-run-time-library) +- [Potential Errors Passing CRT Objects Across DLL Boundaries](https://learn.microsoft.com/cpp/c-runtime-library/potential-errors-passing-crt-objects-across-dll-boundaries) If your app is misbehaving in some strange way, or it is suffering from memory corruption, before asking for further help, please try first to rebuild every single library your app uses as well as your app using the debug multi-threaded dynamic C runtime. - If you get linkage errors read section 5.7 of the FAQ document. +If you get linkage errors read section 5.7 of the FAQ document. ## Cygwin @@ -254,14 +254,14 @@ Download the latest version of the `cygwin` packages required (*and suggested*) Package List ``` - binutil - required - gcc-core - required - libpsl-devel - required - libtool - required - perl - required - make - required - - NOTE - if there is an error regarding make, open the cygwin terminal, and run: - ln -s /usr/bin/make /usr/bin/gmake + binutil - required + gcc-core - required + libpsl-devel - required + libtool - required + perl - required + make - required + - NOTE - if there is an error regarding make, open the cygwin terminal, and run: + ln -s /usr/bin/make /usr/bin/gmake ``` @@ -282,13 +282,14 @@ Once all the packages have been installed, begin the process of installing curl - 1. `sh configure ` - 2. `make` +1. `sh configure ` +2. `make` If any error occurs during curl installation, try: - - reinstalling the required `cygwin` packages from the list above - - temporarily move `cygwin` to the top of your path - - install all of the suggested `cygwin` packages + +- reinstalling the required `cygwin` packages from the list above +- temporarily move `cygwin` to the top of your path +- install all of the suggested `cygwin` packages ## MS-DOS @@ -323,11 +324,11 @@ cmake . \ Notes: - - Requires DJGPP 2.04 or upper. +- Requires DJGPP 2.04 or upper. - - Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise - things go wrong because things like FS-extensions and `errno` values have - been changed between releases. +- Compile Watt-32 (and OpenSSL) with the same version of DJGPP. Otherwise + things go wrong because things like FS-extensions and `errno` values have + been changed between releases. ## AmigaOS @@ -373,9 +374,9 @@ for the full list. If you want to set any of these defines you have the following options: - - Modify `lib/config-win32.h` - - Modify `lib/curl_setup.h` - - Modify the "Preprocessor Definitions" in the libcurl project +- Modify `lib/config-win32.h` +- Modify `lib/curl_setup.h` +- Modify the "Preprocessor Definitions" in the libcurl project Note: The pre-processor settings can be found using the Visual Studio IDE under "Project -> Properties -> Configuration Properties -> C/C++ -> @@ -388,8 +389,8 @@ necessary to make the definition of the preprocessor symbol `USE_LWIPSOCK` visible to libcurl and curl compilation processes. To set this definition you have the following alternatives: - - Modify `lib/config-win32.h` - - Modify the "Preprocessor Definitions" in the libcurl project +- Modify `lib/config-win32.h` +- Modify the "Preprocessor Definitions" in the libcurl project Note: The pre-processor settings can be found using the Visual Studio IDE under "Project -> Properties -> Configuration Properties -> C/C++ -> @@ -578,47 +579,47 @@ know your application is not going to need. Besides specifying the use, here are some other flags that can reduce the size of the library by disabling support for some features (run `./configure --help` to see them all): - - `--disable-aws` (cryptographic authentication) - - `--disable-basic-auth` (cryptographic authentication) - - `--disable-bearer-auth` (cryptographic authentication) - - `--disable-digest-auth` (cryptographic authentication) - - `--disable-http-auth` (all HTTP authentication) - - `--disable-kerberos-auth` (cryptographic authentication) - - `--disable-negotiate-auth` (cryptographic authentication) - - `--disable-ntlm` (NTLM authentication) - - `--disable-alt-svc` (HTTP Alt-Svc) - - `--disable-ares` (the C-ARES DNS library) - - `--disable-cookies` (HTTP cookies) - - `--disable-dateparse` (date parsing for time conditionals) - - `--disable-dnsshuffle` (internal server load spreading) - - `--disable-doh` (DNS-over-HTTP) - - `--disable-form-api` (POST form API) - - `--disable-get-easy-options` (lookup easy options at runtime) - - `--disable-headers-api` (API to access headers) - - `--disable-hsts` (HTTP Strict Transport Security) - - `--disable-ipv6` (IPv6) - - `--disable-libcurl-option` (--libcurl C code generation support) - - `--disable-manual` (--manual built-in documentation) - - `--disable-mime` (MIME API) - - `--disable-netrc` (.netrc file) - - `--disable-progress-meter` (graphical progress meter in library) - - `--disable-proxy` (HTTP and SOCKS proxies) - - `--disable-socketpair` (socketpair for asynchronous name resolving) - - `--disable-threaded-resolver` (threaded name resolver) - - `--disable-tls-srp` (Secure Remote Password authentication for TLS) - - `--disable-unix-sockets` (Unix sockets) - - `--disable-verbose` (eliminates debugging strings and error code strings) - - `--disable-versioned-symbols` (versioned symbols) - - `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library) - - `--without-brotli` (Brotli on-the-fly decompression) - - `--without-libpsl` (Public Suffix List in cookies) - - `--without-nghttp2` (HTTP/2 using nghttp2) - - `--without-ngtcp2` (HTTP/2 using ngtcp2) - - `--without-zstd` (Zstd on-the-fly decompression) - - `--without-libidn2` (internationalized domain names) - - `--without-librtmp` (RTMP) - - `--without-ssl` (SSL/TLS) - - `--without-zlib` (gzip/deflate on-the-fly decompression) +- `--disable-aws` (cryptographic authentication) +- `--disable-basic-auth` (cryptographic authentication) +- `--disable-bearer-auth` (cryptographic authentication) +- `--disable-digest-auth` (cryptographic authentication) +- `--disable-http-auth` (all HTTP authentication) +- `--disable-kerberos-auth` (cryptographic authentication) +- `--disable-negotiate-auth` (cryptographic authentication) +- `--disable-ntlm` (NTLM authentication) +- `--disable-alt-svc` (HTTP Alt-Svc) +- `--disable-ares` (the C-ARES DNS library) +- `--disable-cookies` (HTTP cookies) +- `--disable-dateparse` (date parsing for time conditionals) +- `--disable-dnsshuffle` (internal server load spreading) +- `--disable-doh` (DNS-over-HTTP) +- `--disable-form-api` (POST form API) +- `--disable-get-easy-options` (lookup easy options at runtime) +- `--disable-headers-api` (API to access headers) +- `--disable-hsts` (HTTP Strict Transport Security) +- `--disable-ipv6` (IPv6) +- `--disable-libcurl-option` (--libcurl C code generation support) +- `--disable-manual` (--manual built-in documentation) +- `--disable-mime` (MIME API) +- `--disable-netrc` (.netrc file) +- `--disable-progress-meter` (graphical progress meter in library) +- `--disable-proxy` (HTTP and SOCKS proxies) +- `--disable-socketpair` (socketpair for asynchronous name resolving) +- `--disable-threaded-resolver` (threaded name resolver) +- `--disable-tls-srp` (Secure Remote Password authentication for TLS) +- `--disable-unix-sockets` (Unix sockets) +- `--disable-verbose` (eliminates debugging strings and error code strings) +- `--disable-versioned-symbols` (versioned symbols) +- `--enable-symbol-hiding` (eliminates unneeded symbols in the shared library) +- `--without-brotli` (Brotli on-the-fly decompression) +- `--without-libpsl` (Public Suffix List in cookies) +- `--without-nghttp2` (HTTP/2 using nghttp2) +- `--without-ngtcp2` (HTTP/2 using ngtcp2) +- `--without-zstd` (Zstd on-the-fly decompression) +- `--without-libidn2` (internationalized domain names) +- `--without-librtmp` (RTMP) +- `--without-ssl` (SSL/TLS) +- `--without-zlib` (gzip/deflate on-the-fly decompression) Be sure also to strip debugging symbols from your binaries after compiling using 'strip' or an option like `-s`. If space is really tight, you may be able @@ -639,10 +640,10 @@ relevant tests by specifying certain key words on the `runtests.pl` command line. Following is a list of appropriate key words for those configure options that are not automatically detected: - - `--disable-cookies` !cookies - - `--disable-dateparse` !RETRY-AFTER !`CURLOPT_TIMECONDITION` !`CURLINFO_FILETIME` !`If-Modified-Since` !`curl_getdate` !`-z` - - `--disable-libcurl-option` !`--libcurl` - - `--disable-verbose` !verbose\ logs +- `--disable-cookies` !cookies +- `--disable-dateparse` !RETRY-AFTER !`CURLOPT_TIMECONDITION` !`CURLINFO_FILETIME` !`If-Modified-Since` !`curl_getdate` !`-z` +- `--disable-libcurl-option` !`--libcurl` +- `--disable-verbose` !verbose\ logs # Ports diff --git a/docs/INTERNALS.md b/docs/INTERNALS.md index 222d9ab5ed..aebcd7010c 100644 --- a/docs/INTERNALS.md +++ b/docs/INTERNALS.md @@ -12,55 +12,54 @@ versions of libs and build tools. ## Portability - We write curl and libcurl to compile with C89 compilers on 32-bit and up - machines. Most of libcurl assumes more or less POSIX compliance but that is - not a requirement. +We write curl and libcurl to compile with C89 compilers on 32-bit and up +machines. Most of libcurl assumes more or less POSIX compliance but that is +not a requirement. - We write libcurl to build and work with lots of third party tools, and we - want it to remain functional and buildable with these and later versions - (older versions may still work but is not what we work hard to maintain): +We write libcurl to build and work with lots of third party tools, and we +want it to remain functional and buildable with these and later versions +(older versions may still work but is not what we work hard to maintain): ## Dependencies - We aim to support these or later versions. +We aim to support these or later versions. - - brotli 1.0.0 (2017-09-21) - - c-ares 1.6.0 (2008-12-09) - - GnuTLS 3.6.5 (2018-12-01) - - libidn2 2.0.0 (2017-03-29) - - LibreSSL 2.9.1 (2019-04-22) - - libssh 0.9.0 (2019-06-28) - - libssh2 1.9.0 (2019-06-20) - - mbedTLS 3.2.0 (2022-07-11) - - MIT Kerberos 1.3 (2003-07-31) - - nghttp2 1.15.0 (2016-09-25) - - OpenLDAP 2.0 (2000-08-01) - - OpenSSL 3.0.0 (2021-09-07) - - Windows XP 5.1 (2001-08-24 - 2009-04-14) - - wolfSSL 3.4.6 (2017-09-22) - - zlib 1.2.5.2 (2011-12-11) - - zstd 1.0 (2016-08-31) +- brotli 1.0.0 (2017-09-21) +- c-ares 1.6.0 (2008-12-09) +- GnuTLS 3.6.5 (2018-12-01) +- libidn2 2.0.0 (2017-03-29) +- LibreSSL 2.9.1 (2019-04-22) +- libssh 0.9.0 (2019-06-28) +- libssh2 1.9.0 (2019-06-20) +- mbedTLS 3.2.0 (2022-07-11) +- MIT Kerberos 1.3 (2003-07-31) +- nghttp2 1.15.0 (2016-09-25) +- OpenLDAP 2.0 (2000-08-01) +- OpenSSL 3.0.0 (2021-09-07) +- Windows XP 5.1 (2001-08-24 - 2009-04-14) +- wolfSSL 3.4.6 (2017-09-22) +- zlib 1.2.5.2 (2011-12-11) +- zstd 1.0 (2016-08-31) ## Build tools - When writing code (mostly for generating stuff included in release tarballs) - we use a few "build tools" and we make sure that we remain functional with - these versions: +When writing code (mostly for generating stuff included in release tarballs) +we use a few "build tools" and we make sure that we remain functional with +these versions: - - cmake 3.7 (2016-11-11) - - GNU autoconf 2.59 (2003-11-06) - - GNU automake 1.7 (2002-09-25) - - GNU libtool 1.4.2 (2001-09-11) - - GNU m4 1.4 (2007-09-21) - - mingw-w64 3.0 (2013-09-20) - - perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01) - - Visual Studio 2010 10.0 (2010-04-12 - 2020-07-14) +- cmake 3.7 (2016-11-11) +- GNU autoconf 2.59 (2003-11-06) +- GNU automake 1.7 (2002-09-25) +- GNU libtool 1.4.2 (2001-09-11) +- GNU m4 1.4 (2007-09-21) +- mingw-w64 3.0 (2013-09-20) +- perl 5.8 (2002-07-19), on Windows: 5.22 (2015-06-01) +- Visual Studio 2010 10.0 (2010-04-12 - 2020-07-14) -Library Symbols -=============== +## Library Symbols - All symbols used internally in libcurl must use a `Curl_` prefix if they are - used in more than a single file. Single-file symbols must be made static. - Public ("exported") symbols must use a `curl_` prefix. Public API functions - are marked with `CURL_EXTERN` in the public header files so that all others - can be hidden on platforms where this is possible. +All symbols used internally in libcurl must use a `Curl_` prefix if they are +used in more than a single file. Single-file symbols must be made static. +Public ("exported") symbols must use a `curl_` prefix. Public API functions +are marked with `CURL_EXTERN` in the public header files so that all others +can be hidden on platforms where this is possible. diff --git a/docs/KNOWN_BUGS.md b/docs/KNOWN_BUGS.md index e22024ae80..ae6519bfff 100644 --- a/docs/KNOWN_BUGS.md +++ b/docs/KNOWN_BUGS.md @@ -181,9 +181,9 @@ libcurl are not equipped for that at the moment except when built with _UNICODE and UNICODE defined. Except for Cygwin, Windows cannot use UTF-8 as a locale. - https://curl.se/bug/?i=345 - https://curl.se/bug/?i=731 - https://curl.se/bug/?i=3747 +https://curl.se/bug/?i=345 +https://curl.se/bug/?i=731 +https://curl.se/bug/?i=3747 NTLM authentication and Unicode diff --git a/docs/KNOWN_RISKS.md b/docs/KNOWN_RISKS.md index 6138df7f26..0b22ce0b0c 100644 --- a/docs/KNOWN_RISKS.md +++ b/docs/KNOWN_RISKS.md @@ -90,12 +90,12 @@ The curl command blanks the contents of a number of command line arguments to prevent them from appearing in process listings. It does not blank all arguments, even though some that are not blanked might contain sensitive data. - - not all systems allow the arguments to be blanked in the first place - - since curl blanks the argument itself they are readable for a short moment - no matter what - - virtually every argument can contain sensitive data, depending on use - - blanking all arguments would make it impractical for users to differentiate - curl command lines in process listings +- not all systems allow the arguments to be blanked in the first place +- since curl blanks the argument itself they are readable for a short moment + no matter what +- virtually every argument can contain sensitive data, depending on use +- blanking all arguments would make it impractical for users to differentiate + curl command lines in process listings ## HTTP headers in redirects diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 5ee3aa9f7b..ff66cc5a72 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -503,18 +503,18 @@ happening. The different fields in the output have the following meaning: From left-to-right: - - `%` - percentage completed of the whole transfer - - `Total` - total size of the whole expected transfer - - `%` - percentage completed of the download - - `Received` - currently downloaded amount of bytes - - `%` - percentage completed of the upload - - `Xferd` - currently uploaded amount of bytes - - `Average Speed Dload` - the average transfer speed of the download - - `Average Speed Upload` - the average transfer speed of the upload - - `Time Total` - expected time to complete the operation - - `Time Current` - time passed since the invoke - - `Time Left` - expected time left to completion - - `Curr.Speed` - the average transfer speed the last 5 seconds (the first +- `%` - percentage completed of the whole transfer +- `Total` - total size of the whole expected transfer +- `%` - percentage completed of the download +- `Received` - currently downloaded amount of bytes +- `%` - percentage completed of the upload +- `Xferd` - currently uploaded amount of bytes +- `Average Speed Dload` - the average transfer speed of the download +- `Average Speed Upload` - the average transfer speed of the upload +- `Time Total` - expected time to complete the operation +- `Time Current` - time passed since the invoke +- `Time Left` - expected time left to completion +- `Curr.Speed` - the average transfer speed the last 5 seconds (the first 5 seconds of a transfer is based on less time of course.) The `-#` option displays a totally different progress bar that does not need @@ -907,8 +907,8 @@ tell the server we use a vt100 terminal, try something like: Other interesting options for it `-t` include: - - `XDISPLOC=` Sets the X display location. - - `NEW_ENV=` Sets an environment variable. +- `XDISPLOC=` Sets the X display location. +- `NEW_ENV=` Sets an environment variable. NOTE: The telnet protocol does not specify any way to login with a specified user and password so curl cannot do that automatically. To do that, you need to diff --git a/docs/Makefile.am b/docs/Makefile.am index c0c25232b8..fa7ab3d331 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -41,93 +41,93 @@ if BUILD_DOCS CLEANFILES = $(MK_CA_DOCS) $(man_MANS) $(TEST_DOCS) endif -TESTDOCS = \ - tests/FILEFORMAT.md \ - tests/HTTP.md \ - tests/TEST-SUITE.md +TESTDOCS = \ + tests/FILEFORMAT.md \ + tests/HTTP.md \ + tests/TEST-SUITE.md -INTERNALDOCS = \ - internals/BUFQ.md \ - internals/BUFREF.md \ - internals/CHECKSRC.md \ - internals/CLIENT-READERS.md \ - internals/CLIENT-WRITERS.md \ - internals/CODE_STYLE.md \ - internals/CONNECTION-FILTERS.md \ - internals/CURLX.md \ - internals/DYNBUF.md \ - internals/HASH.md \ - internals/LLIST.md \ - internals/MID.md \ - internals/MQTT.md \ - internals/MULTI-EV.md \ - internals/NEW-PROTOCOL.md \ - internals/PORTING.md \ - internals/RATELIMITS.md \ - internals/README.md \ - internals/SCORECARD.md \ - internals/SPLAY.md \ - internals/STRPARSE.md \ - internals/TIME-KEEPING.md \ - internals/TLS-SESSIONS.md \ - internals/UINT_SETS.md \ - internals/WEBSOCKET.md +INTERNALDOCS = \ + internals/BUFQ.md \ + internals/BUFREF.md \ + internals/CHECKSRC.md \ + internals/CLIENT-READERS.md \ + internals/CLIENT-WRITERS.md \ + internals/CODE_STYLE.md \ + internals/CONNECTION-FILTERS.md \ + internals/CURLX.md \ + internals/DYNBUF.md \ + internals/HASH.md \ + internals/LLIST.md \ + internals/MID.md \ + internals/MQTT.md \ + internals/MULTI-EV.md \ + internals/NEW-PROTOCOL.md \ + internals/PORTING.md \ + internals/RATELIMITS.md \ + internals/README.md \ + internals/SCORECARD.md \ + internals/SPLAY.md \ + internals/STRPARSE.md \ + internals/TIME-KEEPING.md \ + internals/TLS-SESSIONS.md \ + internals/UINT_SETS.md \ + internals/WEBSOCKET.md -EXTRA_DIST = \ - $(CURLPAGES) \ - $(INTERNALDOCS) \ - $(TESTDOCS) \ - ALTSVC.md \ - BINDINGS.md \ - BUG-BOUNTY.md \ - BUGS.md \ - CIPHERS.md \ - CIPHERS-TLS12.md \ - CMakeLists.txt \ - CODE_OF_CONDUCT.md \ - CODE_REVIEW.md \ - CONTRIBUTE.md \ - CURL-DISABLE.md \ - CURLDOWN.md \ - DEPRECATE.md \ - DISTROS.md \ - EARLY-RELEASE.md \ - ECH.md \ - EXPERIMENTAL.md \ - FAQ.md \ - FEATURES.md \ - GOVERNANCE.md \ - HELP-US.md \ - HISTORY.md \ - HSTS.md \ - HTTP-COOKIES.md \ - HTTP3.md \ - HTTPSRR.md \ - INFRASTRUCTURE.md \ - INSTALL \ - INSTALL-CMAKE.md \ - INSTALL.md \ - INTERNALS.md \ - IPFS.md \ - KNOWN_BUGS.md \ - KNOWN_RISKS.md \ - MAIL-ETIQUETTE.md \ - MANUAL.md \ - options-in-versions \ - README.md \ - RELEASE-PROCEDURE.md \ - RUSTLS.md \ - ROADMAP.md \ - SECURITY-ADVISORY.md \ - SPONSORS.md \ - SSL-PROBLEMS.md \ - SSLCERTS.md \ - THANKS \ - TODO.md \ - TheArtOfHttpScripting.md \ - URL-SYNTAX.md \ - VERSIONS.md \ - VULN-DISCLOSURE-POLICY.md +EXTRA_DIST = \ + $(CURLPAGES) \ + $(INTERNALDOCS) \ + $(TESTDOCS) \ + ALTSVC.md \ + BINDINGS.md \ + BUG-BOUNTY.md \ + BUGS.md \ + CIPHERS.md \ + CIPHERS-TLS12.md \ + CMakeLists.txt \ + CODE_OF_CONDUCT.md \ + CODE_REVIEW.md \ + CONTRIBUTE.md \ + CURL-DISABLE.md \ + CURLDOWN.md \ + DEPRECATE.md \ + DISTROS.md \ + EARLY-RELEASE.md \ + ECH.md \ + EXPERIMENTAL.md \ + FAQ.md \ + FEATURES.md \ + GOVERNANCE.md \ + HELP-US.md \ + HISTORY.md \ + HSTS.md \ + HTTP-COOKIES.md \ + HTTP3.md \ + HTTPSRR.md \ + INFRASTRUCTURE.md \ + INSTALL \ + INSTALL-CMAKE.md \ + INSTALL.md \ + INTERNALS.md \ + IPFS.md \ + KNOWN_BUGS.md \ + KNOWN_RISKS.md \ + MAIL-ETIQUETTE.md \ + MANUAL.md \ + options-in-versions \ + README.md \ + RELEASE-PROCEDURE.md \ + RUSTLS.md \ + ROADMAP.md \ + SECURITY-ADVISORY.md \ + SPONSORS.md \ + SSL-PROBLEMS.md \ + SSLCERTS.md \ + THANKS \ + TODO.md \ + TheArtOfHttpScripting.md \ + URL-SYNTAX.md \ + VERSIONS.md \ + VULN-DISCLOSURE-POLICY.md CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@ diff --git a/docs/TODO.md b/docs/TODO.md index 9d6211e6c7..cc13a91b61 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -427,7 +427,7 @@ context information ourselves. `CURLOPT_SSL_CTX_FUNCTION` works perfectly for HTTPS and email protocols, but it has no effect for LDAPS connections. - [curl issue 4108](https://github.com/curl/curl/issues/4108) +[curl issue 4108](https://github.com/curl/curl/issues/4108) ## Paged searches on LDAP server diff --git a/docs/URL-SYNTAX.md b/docs/URL-SYNTAX.md index d69ab67479..b9f27401e4 100644 --- a/docs/URL-SYNTAX.md +++ b/docs/URL-SYNTAX.md @@ -11,9 +11,9 @@ SPDX-License-Identifier: curl The official "URL syntax" is primarily defined in these two different specifications: - - [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) (although URL is called - "URI" in there) - - [The WHATWG URL Specification](https://url.spec.whatwg.org/) +- [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986) (although URL is called + "URI" in there) +- [The WHATWG URL Specification](https://url.spec.whatwg.org/) RFC 3986 is the earlier one, and curl has always tried to adhere to that one (since it shipped in January 2005). @@ -100,13 +100,13 @@ supported by browsers early on and has been mimicked by curl. Based on what the hostname starts with, curl "guesses" what protocol to use: - - `ftp.` means FTP - - `dict.` means DICT - - `ldap.` means LDAP - - `imap.` means IMAP - - `smtp.` means SMTP - - `pop3.` means POP3 - - all other means HTTP +- `ftp.` means FTP +- `dict.` means DICT +- `ldap.` means LDAP +- `imap.` means IMAP +- `smtp.` means SMTP +- `pop3.` means POP3 +- all other means HTTP ### Globbing letters diff --git a/docs/VULN-DISCLOSURE-POLICY.md b/docs/VULN-DISCLOSURE-POLICY.md index 3e924d82b8..51031a2217 100644 --- a/docs/VULN-DISCLOSURE-POLICY.md +++ b/docs/VULN-DISCLOSURE-POLICY.md @@ -277,12 +277,12 @@ arguments, even though some that are not blanked might contain sensitive data. We consider this functionality a best-effort and omissions are not security vulnerabilities. - - not all systems allow the arguments to be blanked in the first place - - since curl blanks the argument itself they are readable for a short moment - no matter what - - virtually every argument can contain sensitive data, depending on use - - blanking all arguments would make it impractical for users to differentiate - curl command lines in process listings +- not all systems allow the arguments to be blanked in the first place +- since curl blanks the argument itself they are readable for a short moment + no matter what +- virtually every argument can contain sensitive data, depending on use +- blanking all arguments would make it impractical for users to differentiate + curl command lines in process listings ## Busy-loops diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index 84e02f5c6b..285908da16 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -25,12 +25,12 @@ * Get a webpage, extract the title with libxml. * - Written by Lars Nilsson + Written by Lars Nilsson - GNU C++ compile command line suggestion (edit paths accordingly): + GNU C++ compile command line suggestion (edit paths accordingly): - g++ -Wall -I/opt/curl/include -I/opt/libxml/include/libxml2 htmltitle.cpp \ - -o htmltitle -L/opt/curl/lib -L/opt/libxml/lib -lcurl -lxml2 + g++ -Wall -I/opt/curl/include -I/opt/libxml/include/libxml2 htmltitle.cpp \ + -o htmltitle -L/opt/curl/lib -L/opt/libxml/lib -lcurl -lxml2 */ #include #include @@ -42,7 +42,7 @@ #include // -// Case-insensitive string comparison +// Case-insensitive string comparison // #ifdef _WIN32 @@ -52,7 +52,7 @@ #endif // -// libxml callback context structure +// libxml callback context structure // struct Context { Context() : addTitle(false) {} @@ -62,13 +62,13 @@ struct Context { }; // -// libcurl variables for error strings and returned data +// libcurl variables for error strings and returned data static char errorBuffer[CURL_ERROR_SIZE]; static std::string buffer; // -// libcurl write callback function +// libcurl write callback function // static size_t writer(char *data, size_t size, size_t nmemb, std::string *writerData) @@ -82,7 +82,7 @@ static size_t writer(char *data, size_t size, size_t nmemb, } // -// libcurl connection initialization +// libcurl connection initialization // static bool init(CURL *&curl, const char *url) { @@ -129,7 +129,7 @@ static bool init(CURL *&curl, const char *url) } // -// libxml start element callback function +// libxml start element callback function // static void StartElement(void *voidContext, const xmlChar *name, @@ -145,7 +145,7 @@ static void StartElement(void *voidContext, } // -// libxml end element callback function +// libxml end element callback function // static void EndElement(void *voidContext, const xmlChar *name) @@ -157,7 +157,7 @@ static void EndElement(void *voidContext, } // -// Text handling helper function +// Text handling helper function // static void handleCharacters(Context *context, const xmlChar *chars, @@ -169,7 +169,7 @@ static void handleCharacters(Context *context, } // -// libxml PCDATA callback function +// libxml PCDATA callback function // static void Characters(void *voidContext, const xmlChar *chars, @@ -181,7 +181,7 @@ static void Characters(void *voidContext, } // -// libxml CDATA callback function +// libxml CDATA callback function // static void cdata(void *voidContext, const xmlChar *chars, @@ -193,7 +193,7 @@ static void cdata(void *voidContext, } // -// libxml SAX callback structure +// libxml SAX callback structure // static htmlSAXHandler saxHandler = { NULL, @@ -231,7 +231,7 @@ static htmlSAXHandler saxHandler = { }; // -// Parse given (assumed to be) HTML text and return the title +// Parse given (assumed to be) HTML text and return the title // static void parseHtml(const std::string &html, std::string &title) diff --git a/docs/internals/CONNECTION-FILTERS.md b/docs/internals/CONNECTION-FILTERS.md index 3fbb041a16..a1987f4956 100644 --- a/docs/internals/CONNECTION-FILTERS.md +++ b/docs/internals/CONNECTION-FILTERS.md @@ -34,9 +34,9 @@ Curl_easy *data connectdata *conn cf-ssl cf-socket |https://curl.se/|----> | properties |----> | keys |---> | socket |--> OS --> network +----------------+ +-----------------+ +-------+ +--------+ - Curl_write(data, buffer) +Curl_write(data, buffer) --> Curl_cfilter_write(data, data->conn, buffer) - ---> conn->filter->write(conn->filter, data, buffer) + --> conn->filter->write(conn->filter, data, buffer) ``` While connection filters all do different things, they look the same from the @@ -77,10 +77,9 @@ etc. Each filter does in principle the following: ``` -static CURLcode -myfilter_cf_connect(struct Curl_cfilter *cf, - struct Curl_easy *data, - bool *done) +static CURLcode myfilter_cf_connect(struct Curl_cfilter *cf, + struct Curl_easy *data, + bool *done) { CURLcode result; @@ -140,8 +139,8 @@ filter, once it is connected, just passes the calls through. Those filters implementations look like this: ``` -ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, - const void *buf, size_t len, CURLcode *err) +ssize_t Curl_cf_def_send(struct Curl_cfilter *cf, struct Curl_easy *data, + const void *buf, size_t len, CURLcode *err) { return cf->next->cft->do_send(cf->next, data, buf, len, err); } diff --git a/docs/internals/MQTT.md b/docs/internals/MQTT.md index acf7464be5..7b2fa5668d 100644 --- a/docs/internals/MQTT.md +++ b/docs/internals/MQTT.md @@ -51,7 +51,8 @@ Whenever a PUBLISH packet is received, curl outputs two bytes topic length ## Caveats Remaining limitations: - - Only QoS level 0 is implemented for publish - - No way to set retain flag for publish - - No TLS (mqtts) support - - Naive EAGAIN handling does not handle split messages + +- Only QoS level 0 is implemented for publish +- No way to set retain flag for publish +- No TLS (mqtts) support +- Naive EAGAIN handling does not handle split messages diff --git a/docs/internals/WEBSOCKET.md b/docs/internals/WEBSOCKET.md index 230bb91249..d42ab3cfe7 100644 --- a/docs/internals/WEBSOCKET.md +++ b/docs/internals/WEBSOCKET.md @@ -88,13 +88,13 @@ work has not been started. Ideas: - - Read stdin and send off as messages. Consider newline as end of fragment. - (default to text? offer option to set binary) - - Respond to PINGs automatically - - Issue PINGs at some default interval (option to switch off/change interval?) - - Allow `-d` to specify (initial) data to send (should the format allow for - multiple separate frames?) - - Exit after N messages received, where N can be zero. +- Read stdin and send off as messages. Consider newline as end of fragment. + (default to text? offer option to set binary) +- Respond to PINGs automatically +- Issue PINGs at some default interval (option to switch off/change interval?) +- Allow `-d` to specify (initial) data to send (should the format allow for + multiple separate frames?) +- Exit after N messages received, where N can be zero. ## Future work diff --git a/docs/libcurl/Makefile.inc b/docs/libcurl/Makefile.inc index 6ac49d9fb2..b75782d1ce 100644 --- a/docs/libcurl/Makefile.inc +++ b/docs/libcurl/Makefile.inc @@ -24,107 +24,107 @@ # Shared between CMakeLists.txt and Makefile.am man_MANS = \ - curl_easy_cleanup.3 \ - curl_easy_duphandle.3 \ - curl_easy_escape.3 \ - curl_easy_getinfo.3 \ - curl_easy_header.3 \ - curl_easy_init.3 \ - curl_easy_nextheader.3 \ - curl_easy_option_by_id.3 \ - curl_easy_option_by_name.3 \ - curl_easy_option_next.3 \ - curl_easy_pause.3 \ - curl_easy_perform.3 \ - curl_easy_recv.3 \ - curl_easy_reset.3 \ - curl_easy_send.3 \ - curl_easy_setopt.3 \ - curl_easy_ssls_export.3 \ - curl_easy_ssls_import.3 \ - curl_easy_strerror.3 \ - curl_easy_unescape.3 \ - curl_easy_upkeep.3 \ - curl_escape.3 \ - curl_formadd.3 \ - curl_formfree.3 \ - curl_formget.3 \ - curl_free.3 \ - curl_getdate.3 \ - curl_getenv.3 \ - curl_global_cleanup.3 \ - curl_global_init.3 \ - curl_global_init_mem.3 \ - curl_global_sslset.3 \ - curl_global_trace.3 \ - curl_mime_addpart.3 \ - curl_mime_data.3 \ - curl_mime_data_cb.3 \ - curl_mime_encoder.3 \ - curl_mime_filedata.3 \ - curl_mime_filename.3 \ - curl_mime_free.3 \ - curl_mime_headers.3 \ - curl_mime_init.3 \ - curl_mime_name.3 \ - curl_mime_subparts.3 \ - curl_mime_type.3 \ - curl_mprintf.3 \ - curl_multi_add_handle.3 \ - curl_multi_assign.3 \ - curl_multi_cleanup.3 \ - curl_multi_fdset.3 \ - curl_multi_get_handles.3 \ - curl_multi_get_offt.3 \ - curl_multi_info_read.3 \ - curl_multi_init.3 \ - curl_multi_notify_disable.3 \ - curl_multi_notify_enable.3 \ - curl_multi_perform.3 \ - curl_multi_poll.3 \ - curl_multi_remove_handle.3 \ - curl_multi_setopt.3 \ - curl_multi_socket.3 \ - curl_multi_socket_action.3 \ - curl_multi_socket_all.3 \ - curl_multi_strerror.3 \ - curl_multi_timeout.3 \ - curl_multi_wait.3 \ - curl_multi_waitfds.3 \ - curl_multi_wakeup.3 \ - curl_pushheader_byname.3 \ - curl_pushheader_bynum.3 \ - curl_share_cleanup.3 \ - curl_share_init.3 \ - curl_share_setopt.3 \ - curl_share_strerror.3 \ - curl_slist_append.3 \ - curl_slist_free_all.3 \ - curl_strequal.3 \ - curl_strnequal.3 \ - curl_unescape.3 \ - curl_url.3 \ - curl_url_cleanup.3 \ - curl_url_dup.3 \ - curl_url_get.3 \ - curl_url_set.3 \ - curl_url_strerror.3 \ - curl_version.3 \ - curl_version_info.3 \ - curl_ws_meta.3 \ - curl_ws_recv.3 \ - curl_ws_send.3 \ - curl_ws_start_frame.3 \ - libcurl-easy.3 \ - libcurl-env-dbg.3 \ - libcurl-env.3 \ - libcurl-errors.3 \ - libcurl-multi.3 \ - libcurl-security.3 \ - libcurl-share.3 \ - libcurl-symbols.3 \ - libcurl-thread.3 \ - libcurl-tutorial.3 \ - libcurl-url.3 \ - libcurl-ws.3 \ - libcurl.3 + curl_easy_cleanup.3 \ + curl_easy_duphandle.3 \ + curl_easy_escape.3 \ + curl_easy_getinfo.3 \ + curl_easy_header.3 \ + curl_easy_init.3 \ + curl_easy_nextheader.3 \ + curl_easy_option_by_id.3 \ + curl_easy_option_by_name.3 \ + curl_easy_option_next.3 \ + curl_easy_pause.3 \ + curl_easy_perform.3 \ + curl_easy_recv.3 \ + curl_easy_reset.3 \ + curl_easy_send.3 \ + curl_easy_setopt.3 \ + curl_easy_ssls_export.3 \ + curl_easy_ssls_import.3 \ + curl_easy_strerror.3 \ + curl_easy_unescape.3 \ + curl_easy_upkeep.3 \ + curl_escape.3 \ + curl_formadd.3 \ + curl_formfree.3 \ + curl_formget.3 \ + curl_free.3 \ + curl_getdate.3 \ + curl_getenv.3 \ + curl_global_cleanup.3 \ + curl_global_init.3 \ + curl_global_init_mem.3 \ + curl_global_sslset.3 \ + curl_global_trace.3 \ + curl_mime_addpart.3 \ + curl_mime_data.3 \ + curl_mime_data_cb.3 \ + curl_mime_encoder.3 \ + curl_mime_filedata.3 \ + curl_mime_filename.3 \ + curl_mime_free.3 \ + curl_mime_headers.3 \ + curl_mime_init.3 \ + curl_mime_name.3 \ + curl_mime_subparts.3 \ + curl_mime_type.3 \ + curl_mprintf.3 \ + curl_multi_add_handle.3 \ + curl_multi_assign.3 \ + curl_multi_cleanup.3 \ + curl_multi_fdset.3 \ + curl_multi_get_handles.3 \ + curl_multi_get_offt.3 \ + curl_multi_info_read.3 \ + curl_multi_init.3 \ + curl_multi_notify_disable.3 \ + curl_multi_notify_enable.3 \ + curl_multi_perform.3 \ + curl_multi_poll.3 \ + curl_multi_remove_handle.3 \ + curl_multi_setopt.3 \ + curl_multi_socket.3 \ + curl_multi_socket_action.3 \ + curl_multi_socket_all.3 \ + curl_multi_strerror.3 \ + curl_multi_timeout.3 \ + curl_multi_wait.3 \ + curl_multi_waitfds.3 \ + curl_multi_wakeup.3 \ + curl_pushheader_byname.3 \ + curl_pushheader_bynum.3 \ + curl_share_cleanup.3 \ + curl_share_init.3 \ + curl_share_setopt.3 \ + curl_share_strerror.3 \ + curl_slist_append.3 \ + curl_slist_free_all.3 \ + curl_strequal.3 \ + curl_strnequal.3 \ + curl_unescape.3 \ + curl_url.3 \ + curl_url_cleanup.3 \ + curl_url_dup.3 \ + curl_url_get.3 \ + curl_url_set.3 \ + curl_url_strerror.3 \ + curl_version.3 \ + curl_version_info.3 \ + curl_ws_meta.3 \ + curl_ws_recv.3 \ + curl_ws_send.3 \ + curl_ws_start_frame.3 \ + libcurl-easy.3 \ + libcurl-env-dbg.3 \ + libcurl-env.3 \ + libcurl-errors.3 \ + libcurl-multi.3 \ + libcurl-security.3 \ + libcurl-share.3 \ + libcurl-symbols.3 \ + libcurl-thread.3 \ + libcurl-tutorial.3 \ + libcurl-url.3 \ + libcurl-ws.3 \ + libcurl.3 diff --git a/docs/libcurl/curl_formget.md b/docs/libcurl/curl_formget.md index 4c4726c315..0da0150a90 100644 --- a/docs/libcurl/curl_formget.md +++ b/docs/libcurl/curl_formget.md @@ -34,8 +34,8 @@ accepts a void pointer as second argument named *userp* which is passed as the first argument to the curl_formget_callback function. ~~~c - typedef size_t (*curl_formget_callback)(void *userp, const char *buf, - size_t len);" +typedef size_t (*curl_formget_callback)(void *userp, const char *buf, + size_t len); ~~~ The *curl_formget_callback* is invoked for each part of the HTTP POST chain. diff --git a/docs/libcurl/curl_multi_info_read.md b/docs/libcurl/curl_multi_info_read.md index 17f8842343..27ec408f86 100644 --- a/docs/libcurl/curl_multi_info_read.md +++ b/docs/libcurl/curl_multi_info_read.md @@ -52,14 +52,14 @@ in that struct and can be used in subsequent regular curl_easy_getinfo(3) calls (or similar): ~~~c - struct CURLMsg { - CURLMSG msg; /* what this message means */ - CURL *easy_handle; /* the handle it concerns */ - union { - void *whatever; /* message-specific data */ - CURLcode result; /* return code for transfer */ - } data; - }; +struct CURLMsg { + CURLMSG msg; /* what this message means */ + CURL *easy_handle; /* the handle it concerns */ + union { + void *whatever; /* message-specific data */ + CURLcode result; /* return code for transfer */ + } data; +}; ~~~ When **msg** is *CURLMSG_DONE*, the message identifies a transfer that is done, and then **result** contains the return code for the easy handle diff --git a/docs/libcurl/libcurl-multi.md b/docs/libcurl/libcurl-multi.md index 27f153b8ad..01bef3a77f 100644 --- a/docs/libcurl/libcurl-multi.md +++ b/docs/libcurl/libcurl-multi.md @@ -177,7 +177,7 @@ multi interface. While we certainly want and intend for these to get fixed in the future, you should be aware of the following current restrictions: ~~~c - - Name resolves unless the c-ares or threaded-resolver backends are used - - file:// transfers - - TELNET transfers +- Name resolves unless the c-ares or threaded-resolver backends are used +- file:// transfers +- TELNET transfers ~~~ diff --git a/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md b/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md index 767092abe6..cb8fd354c7 100644 --- a/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_CONV_FROM_UTF8_FUNCTION.md @@ -53,7 +53,7 @@ CURLE_CONV_REQD error code. If HAVE_ICONV is defined, CURL_ICONV_CODESET_OF_HOST must also be defined. For example: ~~~c - #define CURL_ICONV_CODESET_OF_HOST "IBM-1047" +#define CURL_ICONV_CODESET_OF_HOST "IBM-1047" ~~~ The iconv code in libcurl defaults the network and UTF8 codeset names as diff --git a/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md b/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md index 27d8bf8c06..9bd1739202 100644 --- a/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md +++ b/docs/libcurl/opts/CURLOPT_INTERLEAVEDATA.md @@ -60,7 +60,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_INTERLEAVEDATA, &rtp_data); curl_easy_perform(curl); - } + } } ~~~ diff --git a/docs/runtests.md b/docs/runtests.md index c81172403a..1683f8a7ec 100644 --- a/docs/runtests.md +++ b/docs/runtests.md @@ -5,7 +5,7 @@ Title: runtests.pl Section: 1 Source: runtests See-also: - - runtests.pl + - runtests.pl Added-in: 7.5 --- diff --git a/docs/testcurl.md b/docs/testcurl.md index b5149e098b..6c5237ee7c 100644 --- a/docs/testcurl.md +++ b/docs/testcurl.md @@ -5,7 +5,7 @@ Title: testcurl.pl Section: 1 Source: testcurl See-also: - - runtests.pl + - runtests.pl Added-in: 7.11.2 --- diff --git a/docs/tests/CI.md b/docs/tests/CI.md index 1730f1d189..f5e2b531a6 100644 --- a/docs/tests/CI.md +++ b/docs/tests/CI.md @@ -11,13 +11,13 @@ large number of test suites. Every pull request is verified for each of the following: - - it still builds, warning-free, on Linux, macOS, Windows, BSDs, with both - clang and gcc, autotools and cmake, out-of-tree and in-tree. - - it still builds fine on Windows with all supported MSVC versions - - it follows rudimentary code style rules - - the test suite still runs 100% fine - - the release tarball (the "dist") still works - - different TLS backends and options still compile and pass tests +- it still builds, warning-free, on Linux, macOS, Windows, BSDs, with both + clang and gcc, autotools and cmake, out-of-tree and in-tree. +- it still builds fine on Windows with all supported MSVC versions +- it follows rudimentary code style rules +- the test suite still runs 100% fine +- the release tarball (the "dist") still works +- different TLS backends and options still compile and pass tests If the pull-request fails one of these tests, it shows up as a red X and you are expected to fix the problem. If you do not understand what the issue is or @@ -26,15 +26,15 @@ can likely help out. Consider the following table while looking at pull request failures: - | CI platform as shown in PR | State | What to look at next | - | ----------------------------------- | ------ | -------------------------- | - | Linux / macOS / Windows / ... | stable | all errors and failures | - | Fuzzer | stable | fuzzing results | - | Code analyzers | stable | new findings | - | checkdocs / checksrc / dist / ... | stable | all errors and failures | - | AppVeyor | stable | all errors and failures | - | buildbot/curl_Schannel ... | stable | all errors and failures | - | curl.curl (linux ...) | stable | all errors and failures | +| CI platform as shown in PR | State | What to look at next | +| ----------------------------------- | ------ | -------------------------- | +| Linux / macOS / Windows / ... | stable | all errors and failures | +| Fuzzer | stable | fuzzing results | +| Code analyzers | stable | new findings | +| checkdocs / checksrc / dist / ... | stable | all errors and failures | +| AppVeyor | stable | all errors and failures | +| buildbot/curl_Schannel ... | stable | all errors and failures | +| curl.curl (linux ...) | stable | all errors and failures | Sometimes the tests fail or run slowly due to a dependency service temporarily having issues, for example package downloads, or virtualized (non-native) diff --git a/docs/tests/FILEFORMAT.md b/docs/tests/FILEFORMAT.md index 4749d809e0..fe42432ab0 100644 --- a/docs/tests/FILEFORMAT.md +++ b/docs/tests/FILEFORMAT.md @@ -302,14 +302,14 @@ test file to load the list content. Send back this contents instead of the `` one. The `NUM` is set by: - - The test number in the request line is >10000 and this is the remainder - of [test case number]%10000. - - The request was HTTP and included digest details, which adds 1000 to `NUM` - - If an HTTP request is NTLM type-1, it adds 1001 to `NUM` - - If an HTTP request is NTLM type-3, it adds 1002 to `NUM` - - If an HTTP request is Basic and `NUM` is already >=1000, it adds 1 to `NUM` - - If an HTTP request is Negotiate, `NUM` gets incremented by one for each - request with Negotiate authorization header on the same test case. +- The test number in the request line is >10000 and this is the remainder of + [test case number]%10000. +- The request was HTTP and included digest details, which adds 1000 to `NUM` +- If an HTTP request is NTLM type-1, it adds 1001 to `NUM` +- If an HTTP request is NTLM type-3, it adds 1002 to `NUM` +- If an HTTP request is Basic and `NUM` is already >=1000, it adds 1 to `NUM` +- If an HTTP request is Negotiate, `NUM` gets incremented by one for each + request with Negotiate authorization header on the same test case. Dynamically changing `NUM` in this way allows the test harness to be used to test authentication negotiation where several different requests must be sent diff --git a/include/curl/Makefile.am b/include/curl/Makefile.am index f664f6ab7e..f2810fd307 100644 --- a/include/curl/Makefile.am +++ b/include/curl/Makefile.am @@ -25,7 +25,7 @@ pkginclude_HEADERS = \ curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \ typecheck-gcc.h system.h urlapi.h options.h header.h websockets.h -pkgincludedir= $(includedir)/curl +pkgincludedir = $(includedir)/curl CHECKSRC = $(CS_$(V)) CS_0 = @echo " RUN " $@; diff --git a/lib/Makefile.am b/lib/Makefile.am index c81d8ce0fe..adffdb0352 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -146,8 +146,7 @@ CS_1 = CS_ = $(CS_0) checksrc: - $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \ - $(CSOURCES) $(HHEADERS)) + $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) $(CSOURCES) $(HHEADERS)) if NOT_CURL_CI if DEBUGBUILD diff --git a/lib/curl_range.c b/lib/curl_range.c index 14218f1eee..070dee4289 100644 --- a/lib/curl_range.c +++ b/lib/curl_range.c @@ -30,10 +30,8 @@ /* Only include this function if one or more of FTP, FILE are enabled. */ #if !defined(CURL_DISABLE_FTP) || !defined(CURL_DISABLE_FILE) -/* - Check if this is a range download, and if so, set the internal variables - properly. -*/ +/* Check if this is a range download, and if so, set the internal variables + properly. */ CURLcode Curl_range(struct Curl_easy *data) { if(data->state.use_range && data->state.range) { diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 123c1c14fb..abcb3315b1 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -711,9 +711,9 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, struct kerberos5data *krb5 = Curl_auth_krb5_get(conn); result = !krb5 ? CURLE_OUT_OF_MEMORY : Curl_auth_create_gssapi_user_message(data, conn->user, conn->passwd, - service, conn->host.name, - sasl->mutual_auth, NULL, - krb5, &resp); + service, conn->host.name, + sasl->mutual_auth, NULL, + krb5, &resp); newstate = SASL_GSSAPI_TOKEN; break; } diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index 44ba9be55f..fa568b6b04 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -147,7 +147,7 @@ static CURLcode Curl_sha512_256_update(void *context, * * @param context the calculation context * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE - # bytes + * bytes * @return CURLE_OK if succeed, * error code otherwise */ @@ -229,7 +229,7 @@ static CURLcode Curl_sha512_256_update(void *context, * * @param context the calculation context * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE - # bytes + * bytes * @return always CURLE_OK */ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) @@ -663,7 +663,7 @@ static CURLcode Curl_sha512_256_update(void *context, * * @param context the calculation context * @param[out] digest set to the hash, must be #CURL_SHA512_256_DIGEST_SIZE - # bytes + * bytes * @return always CURLE_OK */ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index 53c079ee26..1e260f2435 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -54,11 +54,11 @@ int curlx_win32_rename(const char *oldpath, const char *newpath); #define curlx_open curlx_win32_open #define curlx_rename curlx_win32_rename #else -#define CURLX_FOPEN_LOW fopen -#define CURLX_FREOPEN_LOW freopen -#define curlx_stat(fname, stp) stat(fname, stp) -#define curlx_open open -#define curlx_rename rename +#define CURLX_FOPEN_LOW fopen +#define CURLX_FREOPEN_LOW freopen +#define curlx_stat(fname, stp) stat(fname, stp) +#define curlx_open open +#define curlx_rename rename #endif #ifdef CURLDEBUG diff --git a/lib/easy.c b/lib/easy.c index 8f32698b93..1bab19f915 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -361,7 +361,7 @@ CURL *curl_easy_init(void) } global_init_unlock(); - /* We use curl_open() with undefined URL so far */ + /* We use Curl_open() with undefined URL so far */ result = Curl_open(&data); if(result) { DEBUGF(curl_mfprintf(stderr, "Error: Curl_open failed\n")); diff --git a/lib/formdata.c b/lib/formdata.c index 8c4dc4830b..b4a7e110d1 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -840,8 +840,7 @@ CURLcode Curl_getformdata(CURL *data, return result; } -#else -/* if disabled */ +#else /* if disabled */ CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...) { diff --git a/lib/memdebug.c b/lib/memdebug.c index a99972fd13..19f69805e1 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -115,6 +115,7 @@ static void curl_dbg_cleanup(void) } #endif } + #ifdef USE_BACKTRACE static void error_bt_callback(void *data, const char *message, int error_number) diff --git a/lib/mime.c b/lib/mime.c index f34e4f91d3..22f43794f9 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -35,10 +35,9 @@ struct Curl_easy; #include "curlx/fopen.h" #include "curlx/base64.h" -#if !defined(CURL_DISABLE_MIME) && \ - (!defined(CURL_DISABLE_HTTP) || \ - !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_IMAP)) +#if !defined(CURL_DISABLE_MIME) && (!defined(CURL_DISABLE_HTTP) || \ + !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_IMAP)) #if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) #include @@ -95,7 +94,7 @@ static const char aschex[] = "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x41\x42\x43\x44\x45\x46"; #ifndef __VMS -#define filesize(name, stat_data) (stat_data.st_size) +#define filesize(name, stat_data) stat_data.st_size #define fopen_read curlx_fopen #else @@ -181,7 +180,7 @@ static FILE *vmsfopenread(const char *file, const char *mode) } #define fopen_read vmsfopenread -#endif +#endif /* !__VMS */ #ifndef HAVE_BASENAME /* @@ -230,7 +229,7 @@ static char *Curl_basename(char *path) } #define basename(x) Curl_basename(x) -#endif +#endif /* !HAVE_BASENAME */ /* Set readback state. */ static void mimesetstate(struct mime_state *state, @@ -2175,7 +2174,8 @@ CURLcode Curl_creader_set_mime(struct Curl_easy *data, curl_mimepart *part) } #else /* !CURL_DISABLE_MIME && (!CURL_DISABLE_HTTP || - !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP) */ + !CURL_DISABLE_SMTP || + !CURL_DISABLE_IMAP) */ /* Mime not compiled in: define stubs for externally-referenced functions. */ curl_mime *curl_mime_init(CURL *easy) diff --git a/lib/mime.h b/lib/mime.h index 81080b449f..5ef05506a4 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -160,8 +160,7 @@ const char *Curl_mime_contenttype(const char *filename); */ CURLcode Curl_creader_set_mime(struct Curl_easy *data, curl_mimepart *part); -#else -/* if disabled */ +#else /* if disabled */ #define Curl_mime_initpart(x) #define Curl_mime_cleanpart(x) #define Curl_mime_duppart(x, y, z) CURLE_OK /* Nothing to duplicate. Succeed */ diff --git a/lib/multi.c b/lib/multi.c index e6b2d19041..4cd37ed466 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -517,8 +517,8 @@ CURLMcode curl_multi_add_handle(CURLM *m, CURL *d) data->set.server_response_timeout; multi->admin->set.no_signal = data->set.no_signal; - CURL_TRC_M(data, "added to multi, mid=%u, running=%u" - ", total=%u", data->mid, Curl_multi_xfers_running(multi), + CURL_TRC_M(data, "added to multi, mid=%u, running=%u, total=%u", + data->mid, Curl_multi_xfers_running(multi), Curl_uint32_tbl_count(&multi->xfers)); return CURLM_OK; } @@ -611,8 +611,7 @@ static void multi_done_locked(struct connectdata *conn, CURL_TRC_M(data, "multi_done_locked, in use=%u", conn->attached_xfers); if(CONN_INUSE(conn)) { /* Stop if still used. */ - CURL_TRC_M(data, - "Connection still in use %u, no more multi_done now!", + CURL_TRC_M(data, "Connection still in use %u, no more multi_done now!", conn->attached_xfers); return; } @@ -885,8 +884,8 @@ CURLMcode curl_multi_remove_handle(CURLM *m, CURL *d) return mresult; } - CURL_TRC_M(data, "removed from multi, mid=%u, running=%u" - ", total=%u", mid, Curl_multi_xfers_running(multi), + CURL_TRC_M(data, "removed from multi, mid=%u, running=%u, total=%u", + mid, Curl_multi_xfers_running(multi), Curl_uint32_tbl_count(&multi->xfers)); return CURLM_OK; } @@ -2710,19 +2709,17 @@ statemachine_end: /* A sub transfer, not for msgsent to application */ struct Curl_easy *mdata; - CURL_TRC_M(data, "sub xfer done for master %u", - data->master_mid); + CURL_TRC_M(data, "sub xfer done for master %u", data->master_mid); mdata = Curl_multi_get_easy(multi, data->master_mid); if(mdata) { if(mdata->sub_xfer_done) mdata->sub_xfer_done(mdata, data, result); else - CURL_TRC_M(data, "master easy %u" - " without sub_xfer_done callback.", data->master_mid); + CURL_TRC_M(data, "master easy %u without sub_xfer_done callback.", + data->master_mid); } else { - CURL_TRC_M(data, "master easy %u already gone.", - data->master_mid); + CURL_TRC_M(data, "master easy %u already gone.", data->master_mid); } } else { @@ -3119,8 +3116,7 @@ static CURLMcode multi_run_dirty(struct multi_run_ctx *mrc) } } else { - CURL_TRC_M(multi->admin, - "multi_run_dirty, %u no longer found", mid); + CURL_TRC_M(multi->admin, "multi_run_dirty, %u no longer found", mid); Curl_uint32_bset_remove(&multi->dirty, mid); } } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); @@ -3342,8 +3338,7 @@ static bool multi_has_dirties(struct Curl_multi *multi) Curl_uint32_bset_remove(&multi->dirty, mid); } else { - CURL_TRC_M(multi->admin, "dirty transfer %u no longer found", - mid); + CURL_TRC_M(multi->admin, "dirty transfer %u no longer found", mid); Curl_uint32_bset_remove(&multi->dirty, mid); } } while(Curl_uint32_bset_next(&multi->dirty, mid, &mid)); @@ -3986,8 +3981,8 @@ struct Curl_easy *Curl_multi_get_easy(struct Curl_multi *multi, struct Curl_easy *data = Curl_uint32_tbl_get(&multi->xfers, mid); if(data && GOOD_EASY_HANDLE(data)) return data; - CURL_TRC_M(multi->admin, - "invalid easy handle in xfer table for mid=%u", mid); + CURL_TRC_M(multi->admin, "invalid easy handle in xfer table for mid=%u", + mid); Curl_uint32_tbl_remove(&multi->xfers, mid); return NULL; } diff --git a/lib/multi_ev.c b/lib/multi_ev.c index 7251c6be3d..0c89721f35 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -581,8 +581,7 @@ void Curl_multi_ev_dirty_xfers(struct Curl_multi *multi, Curl_multi_mark_dirty(data); } else { - CURL_TRC_M(multi->admin, - "socket transfer %u no longer found", mid); + CURL_TRC_M(multi->admin, "socket transfer %u no longer found", mid); Curl_uint32_spbset_remove(&entry->xfers, mid); } } while(Curl_uint32_spbset_next(&entry->xfers, mid, &mid)); diff --git a/lib/multi_ntfy.c b/lib/multi_ntfy.c index 423a03970b..1319aaec07 100644 --- a/lib/multi_ntfy.c +++ b/lib/multi_ntfy.c @@ -110,8 +110,7 @@ static void mntfy_chunk_dispatch_all(struct Curl_multi *multi, /* only when notification has not been disabled in the meantime */ if(data && Curl_uint32_bset_contains(&multi->ntfy.enabled, e->type)) { /* this may cause new notifications to be added! */ - CURL_TRC_M(multi->admin, - "[NTFY] dispatch %u to xfer %u", + CURL_TRC_M(multi->admin, "[NTFY] dispatch %u to xfer %u", e->type, e->mid); multi->ntfy.ntfy_cb(multi, e->type, data, multi->ntfy.ntfy_cb_data); } diff --git a/lib/pop3.c b/lib/pop3.c index 122b34a274..0ba601d6af 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -1295,11 +1295,11 @@ upgrade_tls: if(pp->sendleft) return Curl_pp_flushsend(data, pp); - do { - /* Read the response from the server */ - result = Curl_pp_readresp(data, FIRSTSOCKET, pp, &pop3code, &nread); - if(result) - return result; + do { + /* Read the response from the server */ + result = Curl_pp_readresp(data, FIRSTSOCKET, pp, &pop3code, &nread); + if(result) + return result; if(!pop3code) break; diff --git a/lib/progress.c b/lib/progress.c index 433c2b3498..74c8088b49 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -180,7 +180,6 @@ const struct curltime *Curl_pgrs_now(struct Curl_easy *data) } /* - New proposed interface, 9th of February 2000: pgrsStartNow() - sets start time @@ -190,7 +189,6 @@ const struct curltime *Curl_pgrs_now(struct Curl_easy *data) pgrsSetUploadCounter() - amount of data currently uploaded pgrsUpdate() - show progress pgrsDone() - transfer complete - */ int Curl_pgrsDone(struct Curl_easy *data) @@ -243,7 +241,6 @@ void Curl_pgrsSendPause(struct Curl_easy *data, bool enable) } /* - * * Curl_pgrsTimeWas(). Store the timestamp time at the given label. */ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, @@ -290,8 +287,8 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, case TIMER_STARTTRANSFER: delta = &data->progress.t_starttransfer; /* prevent updating t_starttransfer unless: - * 1) this is the first time we are setting t_starttransfer - * 2) a redirect has occurred since the last time t_starttransfer was set + * 1. this is the first time we are setting t_starttransfer + * 2. a redirect has occurred since the last time t_starttransfer was set * This prevents repeated invocations of the function from incorrectly * changing the t_starttransfer time. */ @@ -321,7 +318,6 @@ void Curl_pgrsTimeWas(struct Curl_easy *data, timerid timer, } /* - * * Curl_pgrsTime(). Store the current time at the given label. This fetches a * fresh "now" and returns it. * @@ -607,8 +603,7 @@ static void progress_meter(struct Curl_easy *data) /* we flush the output stream to make it appear as soon as possible */ fflush(data->set.err); } -#else - /* progress bar disabled */ +#else /* CURL_DISABLE_PROGRESS_METER */ #define progress_meter(x) Curl_nop_stmt #endif diff --git a/lib/ratelimit.h b/lib/ratelimit.h index 07f11b8ff4..ebef9a373e 100644 --- a/lib/ratelimit.h +++ b/lib/ratelimit.h @@ -1,5 +1,5 @@ -#ifndef HEADER_Curl_rlimit_H -#define HEADER_Curl_rlimit_H +#ifndef HEADER_CURL_RLIMIT_H +#define HEADER_CURL_RLIMIT_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -90,4 +90,4 @@ void Curl_rlimit_block(struct Curl_rlimit *r, bool activate, const struct curltime *pts); -#endif /* HEADER_Curl_rlimit_H */ +#endif /* HEADER_CURL_RLIMIT_H */ diff --git a/lib/strerror.c b/lib/strerror.c index b281b1886a..d7de8e6574 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -549,7 +549,6 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen) *buf = '\0'; #ifndef CURL_DISABLE_VERBOSE_STRINGS - switch(err) { case SEC_E_OK: txt = "No error"; @@ -657,7 +656,6 @@ const char *Curl_sspi_strerror(SECURITY_STATUS err, char *buf, size_t buflen) else curl_msnprintf(buf, buflen, "%s (0x%08lx)", txt, err); } - #else if(err == SEC_E_OK) txt = "No error"; diff --git a/lib/url.h b/lib/url.h index e43836eba8..df80b93ab8 100644 --- a/lib/url.h +++ b/lib/url.h @@ -35,7 +35,7 @@ void Curl_init_userdefined(struct Curl_easy *data); void Curl_freeset(struct Curl_easy *data); CURLcode Curl_uc_to_curlcode(CURLUcode uc); -CURLcode Curl_close(struct Curl_easy **datap); /* opposite of curl_open() */ +CURLcode Curl_close(struct Curl_easy **datap); /* opposite of Curl_open() */ CURLcode Curl_connect(struct Curl_easy *, bool *async, bool *protocol_connect); CURLcode Curl_setup_conn(struct Curl_easy *data, struct Curl_dns_entry *dns, diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index f539973802..0d061ebbb0 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -31,7 +31,6 @@ #include "../curl_hmac.h" #include "../curl_md5.h" - /* * Curl_auth_create_cram_md5_message() * diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index a74c2a1aba..5c2ae8db1e 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -147,7 +147,6 @@ bool Curl_auth_allowed_to_host(struct Curl_easy *data) } #ifdef USE_NTLM - static void ntlm_conn_dtor(void *key, size_t klen, void *entry) { struct ntlmdata *ntlm = entry; @@ -175,11 +174,9 @@ void Curl_auth_ntlm_remove(struct connectdata *conn, bool proxy) Curl_conn_meta_remove(conn, proxy ? CURL_META_NTLM_PROXY_CONN : CURL_META_NTLM_CONN); } - #endif /* USE_NTLM */ #ifdef USE_KERBEROS5 - static void krb5_conn_dtor(void *key, size_t klen, void *entry) { struct kerberos5data *krb5 = entry; @@ -201,11 +198,9 @@ struct kerberos5data *Curl_auth_krb5_get(struct connectdata *conn) } return krb5; } - #endif /* USE_KERBEROS5 */ #ifdef USE_GSASL - static void gsasl_conn_dtor(void *key, size_t klen, void *entry) { struct gsasldata *gsasl = entry; @@ -227,11 +222,9 @@ struct gsasldata *Curl_auth_gsasl_get(struct connectdata *conn) } return gsasl; } - #endif /* USE_GSASL */ #ifdef USE_SPNEGO - static void nego_conn_dtor(void *key, size_t klen, void *entry) { struct negotiatedata *nego = entry; @@ -253,5 +246,4 @@ struct negotiatedata *Curl_auth_nego_get(struct connectdata *conn, bool proxy) } return nego; } - #endif /* USE_SPNEGO */ diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 64509fd4ce..f6a711b9cf 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1395,13 +1395,13 @@ static CURLcode schannel_connect_step2(struct Curl_cfilter *cf, inbuf[1].cbBuffer)); /* There are two cases where we could be getting extra data here: - 1) If we are renegotiating a connection and the handshake is already - complete (from the server perspective), it can encrypted app data - (not handshake data) in an extra buffer at this point. - 2) (sspi_status == SEC_I_CONTINUE_NEEDED) We are negotiating a - connection and this extra data is part of the handshake. - We should process the data immediately; waiting for the socket to - be ready may fail since the server is done sending handshake data. + 1. If we are renegotiating a connection and the handshake is already + complete (from the server perspective), it can encrypted app data + (not handshake data) in an extra buffer at this point. + 2. (sspi_status == SEC_I_CONTINUE_NEEDED) We are negotiating a + connection and this extra data is part of the handshake. + We should process the data immediately; waiting for the socket to + be ready may fail since the server is done sending handshake data. */ /* check if the remaining data is less than the total amount and therefore begins after the already processed data */ diff --git a/m4/curl-confopts.m4 b/m4/curl-confopts.m4 index ff1b8b744e..edcd103fba 100644 --- a/m4/curl-confopts.m4 +++ b/m4/curl-confopts.m4 @@ -291,7 +291,7 @@ AC_DEFUN([CURL_CHECK_OPTION_RT], [ AC_MSG_CHECKING([whether to disable dependency on -lrt]) OPT_RT="default" AC_ARG_ENABLE(rt, - AS_HELP_STRING([--disable-rt],[disable dependency on -lrt]), +AS_HELP_STRING([--disable-rt],[disable dependency on -lrt]), OPT_RT=$enableval) case "$OPT_RT" in no) diff --git a/projects/README.md b/projects/README.md index f52f8e477f..802a78f86a 100644 --- a/projects/README.md +++ b/projects/README.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: curl # Packages - This directory and all its subdirectories are for special package -information, templates, scripts and docs. The files herein should be of use -for those of you who want to package curl in a binary or source format for -these platforms. +This directory and all its subdirectories are for special package +information, templates, scripts and docs. The files herein should be of +use for those of you who want to package curl in a binary or source +format for these platforms. diff --git a/projects/Windows/README.md b/projects/Windows/README.md index bf373accde..f33fe57322 100644 --- a/projects/Windows/README.md +++ b/projects/Windows/README.md @@ -81,9 +81,9 @@ the solution or workspace files. The VC directory names are based on the version of Visual C++ that you use. Each version of Visual Studio has a default version of Visual C++. We offer these versions: - - VC10 (Visual Studio 2010 Version 10.0) - - VC11 (Visual Studio 2012 Version 11.0) - - VC12 (Visual Studio 2013 Version 12.0) +- VC10 (Visual Studio 2010 Version 10.0) +- VC11 (Visual Studio 2012 Version 11.0) +- VC12 (Visual Studio 2013 Version 12.0) Separate solutions are provided for both libcurl and the curl command line tool as well as a solution that includes both projects. libcurl.sln, curl.sln @@ -100,10 +100,10 @@ any third-party libraries (such as OpenSSL or libssh2) then you need to add the search path of these DLLs to the configuration's PATH environment. To do that: - 1. Open the 'curl-all.sln' or 'curl.sln' solutions - 2. Right-click on the 'curl' project and select Properties - 3. Navigate to 'Configuration Properties > Debugging > Environment' - 4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` +1. Open the 'curl-all.sln' or 'curl.sln' solutions +2. Right-click on the 'curl' project and select Properties +3. Navigate to 'Configuration Properties > Debugging > Environment' +4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` ... where `Path to DLL` is the configuration specific path. For example the following configurations in Visual Studio 2010 might be: @@ -126,11 +126,11 @@ contain the path to both of these. The following keywords have been used in the directory hierarchy: - - `` - The platform (For example: Windows) - - `` - The IDE (For example: VC10) - - `` - The platform architecture (For example: Win32, Win64) - - `` - The target configuration (For example: DLL Debug, LIB - Release - LIB OpenSSL) +- `` - The platform (For example: Windows) +- `` - The IDE (For example: VC10) +- `` - The platform architecture (For example: Win32, Win64) +- `` - The target configuration (For example: DLL Debug, LIB + Release - LIB OpenSSL) Should you wish to help out with some of the items on the TODO list, or find bugs in the project files that need correcting, and would like to submit diff --git a/projects/vms/Makefile.am b/projects/vms/Makefile.am index e869a8978c..0a061bf20b 100644 --- a/projects/vms/Makefile.am +++ b/projects/vms/Makefile.am @@ -22,38 +22,38 @@ # ########################################################################### EXTRA_DIST = \ - backup_gnv_curl_src.com \ - build_curl-config_script.com \ - build_gnv_curl.com \ - build_gnv_curl_pcsi_desc.com \ - build_gnv_curl_pcsi_text.com \ - build_gnv_curl_release_notes.com \ - build_libcurl_pc.com \ - build_vms.com \ - clean_gnv_curl.com \ - compare_curl_source.com \ - config_h.com \ - curl_crtl_init.c \ - curl_gnv_build_steps.txt \ - curl_release_note_start.txt \ - curl_startup.com \ - curlmsg.h \ - curlmsg.msg \ - curlmsg.sdl \ - curlmsg_vms.h \ - generate_config_vms_h_curl.com \ - generate_vax_transfer.com \ - gnv_conftest.c_first \ - gnv_curl_configure.sh \ - gnv_libcurl_symbols.opt \ - gnv_link_curl.com \ - macro32_exactcase.patch \ - make_gnv_curl_install.sh \ - make_pcsi_curl_kit_name.com \ - pcsi_gnv_curl_file_list.txt \ - pcsi_product_gnv_curl.com \ - readme \ - report_openssl_version.c \ - setup_gnv_curl_build.com \ - stage_curl_install.com \ - vms_eco_level.h + backup_gnv_curl_src.com \ + build_curl-config_script.com \ + build_gnv_curl.com \ + build_gnv_curl_pcsi_desc.com \ + build_gnv_curl_pcsi_text.com \ + build_gnv_curl_release_notes.com \ + build_libcurl_pc.com \ + build_vms.com \ + clean_gnv_curl.com \ + compare_curl_source.com \ + config_h.com \ + curl_crtl_init.c \ + curl_gnv_build_steps.txt \ + curl_release_note_start.txt \ + curl_startup.com \ + curlmsg.h \ + curlmsg.msg \ + curlmsg.sdl \ + curlmsg_vms.h \ + generate_config_vms_h_curl.com \ + generate_vax_transfer.com \ + gnv_conftest.c_first \ + gnv_curl_configure.sh \ + gnv_libcurl_symbols.opt \ + gnv_link_curl.com \ + macro32_exactcase.patch \ + make_gnv_curl_install.sh \ + make_pcsi_curl_kit_name.com \ + pcsi_gnv_curl_file_list.txt \ + pcsi_product_gnv_curl.com \ + readme \ + report_openssl_version.c \ + setup_gnv_curl_build.com \ + stage_curl_install.com \ + vms_eco_level.h diff --git a/projects/vms/gnv_curl_configure.sh b/projects/vms/gnv_curl_configure.sh index 7e74da3463..5f2038f87c 100755 --- a/projects/vms/gnv_curl_configure.sh +++ b/projects/vms/gnv_curl_configure.sh @@ -38,7 +38,7 @@ export GNV_CC_QUALIFIERS=/STANDARD=RELAXED cd ../.. # # -./configure --prefix=/usr --exec-prefix=/usr --disable-dependency-tracking \ - --disable-libtool-lock --with-gssapi --disable-ntlm-wb \ - --with-ca-path=gnv\$curl_ca_path +./configure --prefix=/usr --exec-prefix=/usr --disable-dependency-tracking \ + --disable-libtool-lock --with-gssapi --disable-ntlm-wb \ + --with-ca-path=gnv\$curl_ca_path # diff --git a/scripts/checksrc-all.pl b/scripts/checksrc-all.pl index 764895148e..94dfb67bb5 100755 --- a/scripts/checksrc-all.pl +++ b/scripts/checksrc-all.pl @@ -12,13 +12,13 @@ use Cwd 'abs_path'; my @files; if(system('git rev-parse --is-inside-work-tree >/dev/null 2>&1') == 0) { - @files = `git ls-files '*.[ch]'`; + @files = `git ls-files '*.[ch]'`; } else { - find(sub { if(/\.[ch]$/) { push(@files, $File::Find::name) } }, ('.')); + find(sub { if(/\.[ch]$/) { push(@files, $File::Find::name) } }, ('.')); } if(@ARGV) { - find(sub { if(/\.[ch]$/) { push(@files, $File::Find::name) } }, @ARGV); + find(sub { if(/\.[ch]$/) { push(@files, $File::Find::name) } }, @ARGV); } @files = grep !/\/CMakeFiles\//, @files; diff --git a/scripts/contributors.sh b/scripts/contributors.sh index cea72ff5e5..37f1e5835b 100755 --- a/scripts/contributors.sh +++ b/scripts/contributors.sh @@ -80,16 +80,16 @@ sed -f ./docs/THANKS-filter | \ sort -fu | \ awk ' { - if(length($0)) { - num++; - n = sprintf("%s%s%s,", n, length(n)?" ":"", $0); - #print n; - if(length(n) > 77) { - printf(" %s\n", p); - n=sprintf("%s,", $0); - } - p=n; - } + if(length($0)) { + num++; + n = sprintf("%s%s%s,", n, length(n)?" ":"", $0); + #print n; + if(length(n) > 77) { + printf(" %s\n", p); + n=sprintf("%s,", $0); + } + p=n; + } } END { diff --git a/scripts/managen b/scripts/managen index 88a50acc26..7ea5550da8 100755 --- a/scripts/managen +++ b/scripts/managen @@ -1338,7 +1338,8 @@ my $dir = "."; my $include = "../../include"; my $cmd = shift @ARGV || ''; - check: +check: + if($cmd eq "-d") { # specifies source directory $dir = shift @ARGV; diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index 923af1eb55..f210daf1e5 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -51,8 +51,8 @@ eval "require LWP::UserAgent"; my %urls = ( 'autoland' => 'https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/autoland/security/nss/lib/ckfw/builtins/certdata.txt', - 'beta' => 'https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/beta/security/nss/lib/ckfw/builtins/certdata.txt', - 'release' => 'https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/release/security/nss/lib/ckfw/builtins/certdata.txt', + 'beta' => 'https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/beta/security/nss/lib/ckfw/builtins/certdata.txt', + 'release' => 'https://raw.githubusercontent.com/mozilla-firefox/firefox/refs/heads/release/security/nss/lib/ckfw/builtins/certdata.txt', ); $opt_d = 'release'; @@ -150,12 +150,12 @@ sub warning_message() { if($opt_d =~ m/^risk$/i) { # Long Form Warning and Exit print "Warning: Use of this script may pose some risk:\n"; print "\n"; - print " 1) If you use HTTP URLs they are subject to a man in the middle attack\n"; - print " 2) Default to 'release', but more recent updates may be found in other trees\n"; - print " 3) certdata.txt file format may change, lag time to update this script\n"; - print " 4) Generally unwise to blindly trust CAs without manual review & verification\n"; - print " 5) Mozilla apps use additional security checks are not represented in certdata\n"; - print " 6) Use of this script will make a security engineer grind his teeth and\n"; + print " 1. If you use HTTP URLs they are subject to a man in the middle attack\n"; + print " 2. Default to 'release', but more recent updates may be found in other trees\n"; + print " 3. certdata.txt file format may change, lag time to update this script\n"; + print " 4. Generally unwise to blindly trust CAs without manual review & verification\n"; + print " 5. Mozilla apps use additional security checks are not represented in certdata\n"; + print " 6. Use of this script will make a security engineer grind his teeth and\n"; print " swear at you. ;)\n"; exit; } else { # Short Form Warning diff --git a/src/config2setopts.c b/src/config2setopts.c index d462e8cd54..5e1722c3ee 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -55,7 +55,7 @@ static int get_address_family(curl_socket_t sockfd) #endif #ifndef SOL_IP -# define SOL_IP IPPROTO_IP +#define SOL_IP IPPROTO_IP #endif #if defined(IP_TOS) || defined(IPV6_TCLASS) || defined(SO_PRIORITY) diff --git a/src/tool_bname.c b/src/tool_bname.c index 50d77abb96..f628d819fb 100644 --- a/src/tool_bname.c +++ b/src/tool_bname.c @@ -23,10 +23,10 @@ ***************************************************************************/ #include "tool_setup.h" -#include "tool_bname.h" - #ifndef HAVE_BASENAME +#include "tool_bname.h" + char *tool_basename(char *path) { char *s1; diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index c19f054075..1381ffa317 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -143,7 +143,7 @@ locdone: curlx_free(copyloc); } } -#endif +#endif /* LINK */ /* * Copies a filename part and returns an ALLOCATED data buffer. diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index aebebb5e04..5074ab67b4 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -35,7 +35,7 @@ my $pi = 3.1415; foreach my $i (1 .. 200) { - printf "%d, ", sin($i/200 * 2 * $pi) * 500000 + 500000; + printf "%d, ", sin($i / 200 * 2 * $pi) * 500000 + 500000; } */ static const int sinus[] = { diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 85b60864f9..39d0b4ed14 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -130,7 +130,7 @@ size_t tool_read_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) #endif } else -#endif +#endif /* _WIN32 */ { rc = read(per->infd, buffer, sz * nmemb); if(rc < 0) { diff --git a/src/tool_cb_see.h b/src/tool_cb_see.h index e7b30a765d..e473223526 100644 --- a/src/tool_cb_see.h +++ b/src/tool_cb_see.h @@ -28,7 +28,6 @@ /* ** callback for CURLOPT_SEEKFUNCTION */ - int tool_seek_cb(void *userdata, curl_off_t offset, int whence); #endif /* HEADER_CURL_TOOL_CB_SEE_H */ diff --git a/src/tool_cb_wrt.c b/src/tool_cb_wrt.c index daa8c24154..8d686b6d58 100644 --- a/src/tool_cb_wrt.c +++ b/src/tool_cb_wrt.c @@ -231,7 +231,7 @@ static size_t win_console(intptr_t fhnd, struct OutStruct *outs, *retp = bytes; return 0; } -#endif +#endif /* _WIN32 */ /* ** callback for CURLOPT_WRITEFUNCTION @@ -303,7 +303,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata) return CURL_WRITEFUNC_ERROR; } } -#endif +#endif /* DEBUGBUILD */ if(!outs->stream && !tool_create_output_file(outs, per->config)) return CURL_WRITEFUNC_ERROR; diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c index b907b246c3..3f9dd1bad6 100644 --- a/src/tool_cfgable.c +++ b/src/tool_cfgable.c @@ -120,7 +120,7 @@ static void free_config_fields(struct OperationConfig *config) #ifndef CURL_DISABLE_IPFS tool_safefree(config->ipfs_gateway); -#endif /* !CURL_DISABLE_IPFS */ +#endif tool_safefree(config->doh_url); tool_safefree(config->cipher_list); tool_safefree(config->proxy_cipher_list); diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 329691ec3b..9bd1f59bc9 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -107,7 +107,7 @@ struct OperationConfig { size_t num_urls; /* number of URLs added to the list */ #ifndef CURL_DISABLE_IPFS char *ipfs_gateway; -#endif /* !CURL_DISABLE_IPFS */ +#endif char *doh_url; char *cipher_list; char *proxy_cipher_list; diff --git a/src/tool_findfile.c b/src/tool_findfile.c index c962eb86b8..1fcd74f5a1 100644 --- a/src/tool_findfile.c +++ b/src/tool_findfile.c @@ -145,6 +145,6 @@ char *findfile(const char *fname, int dotscore) return checkhome(home, fname, FALSE); } } -#endif /* PWD-stuff */ +#endif /* HAVE_GETPWUID && HAVE_GETEUID */ return NULL; } diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 841c6fff8b..e51b6f440d 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -182,7 +182,7 @@ static const struct LongShort aliases[]= { {"ip-tos", ARG_STRG, ' ', C_IP_TOS}, #ifndef CURL_DISABLE_IPFS {"ipfs-gateway", ARG_STRG, ' ', C_IPFS_GATEWAY}, -#endif /* !CURL_DISABLE_IPFS */ +#endif {"ipv4", ARG_NONE, '4', C_IPV4}, {"ipv6", ARG_NONE, '6', C_IPV6}, {"json", ARG_STRG, ' ', C_JSON}, @@ -2388,7 +2388,7 @@ static ParameterError opt_string(struct OperationConfig *config, case C_IPFS_GATEWAY: /* --ipfs-gateway */ err = getstr(&config->ipfs_gateway, nextarg, DENY_BLANK); break; -#endif /* !CURL_DISABLE_IPFS */ +#endif case C_AWS_SIGV4: /* --aws-sigv4 */ config->authtype |= CURLAUTH_AWS_SIGV4; err = getstr(&config->aws_sigv4, nextarg, ALLOW_BLANK); diff --git a/src/tool_getpass.c b/src/tool_getpass.c index f2423790fe..a8c7cb2439 100644 --- a/src/tool_getpass.c +++ b/src/tool_getpass.c @@ -58,11 +58,11 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) long sts; short chan; - /* iosbdef.h was not in VAX V7.2 or CC 6.4 */ + /* iosbdef.h was not in VAX V7.2 or CC 6.4 */ struct _isb { - short int iosb$w_status; /* status */ + short int iosb$w_status; /* status */ short int iosb$w_bcnt; /* byte count */ - int unused; /* unused */ + int unused; /* unused */ } iosb; $DESCRIPTOR(ttdesc, "TT"); @@ -86,7 +86,6 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) #endif /* __VMS */ #ifdef _WIN32 - char *getpass_r(const char *prompt, char *buffer, size_t buflen) { size_t i; @@ -100,7 +99,7 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen) } else if(buffer[i] == '\b') /* remove this letter and if this is not the first key, remove the - previous one as well */ + previous one as well */ i = i - (i >= 1 ? 2 : 1); } /* since echo is disabled, print a newline */ diff --git a/src/tool_help.h b/src/tool_help.h index ec763c5d5a..99e6d183e1 100644 --- a/src/tool_help.h +++ b/src/tool_help.h @@ -54,8 +54,8 @@ struct helptxt { }; /* - * The bitmask output is generated with the following command - ------------------------------------------------------------ + The bitmask output is generated with the following command: + ------------------------------------------------------------ make -C docs/cmdline-opts listcats */ diff --git a/src/tool_libinfo.c b/src/tool_libinfo.c index 4ce22bd227..951706e21d 100644 --- a/src/tool_libinfo.c +++ b/src/tool_libinfo.c @@ -46,7 +46,7 @@ const char *proto_tftp = NULL; #ifndef CURL_DISABLE_IPFS const char *proto_ipfs = "ipfs"; const char *proto_ipns = "ipns"; -#endif /* !CURL_DISABLE_IPFS */ +#endif static struct proto_name_tokenp { const char *proto_name; diff --git a/src/tool_main.c b/src/tool_main.c index bd978c46f6..2cb3fd647c 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -207,4 +207,4 @@ int main(int argc, char *argv[]) #endif #endif -#endif /* ndef UNITTESTS */ +#endif /* !UNITTESTS */ diff --git a/src/tool_progress.h b/src/tool_progress.h index 7a474f8b2d..d2ffc9206e 100644 --- a/src/tool_progress.h +++ b/src/tool_progress.h @@ -40,7 +40,6 @@ void progress_finalize(struct per_transfer *per); #ifdef UNITTESTS UNITTEST char *max5data(curl_off_t bytes, char *max5, size_t mlen); UNITTEST void time2str(char *r, size_t rlen, curl_off_t seconds); - #endif #endif /* HEADER_CURL_TOOL_PROGRESS_H */ diff --git a/src/tool_sdecls.h b/src/tool_sdecls.h index fd619be7ee..abee355d17 100644 --- a/src/tool_sdecls.h +++ b/src/tool_sdecls.h @@ -61,7 +61,6 @@ * 'utf8seq' member holds an incomplete UTF-8 sequence destined for the console * until it can be completed (1-4 bytes) + NUL. */ - struct OutStruct { char *filename; FILE *stream; @@ -82,7 +81,6 @@ struct OutStruct { * as well as information relative to where URL contents should * be stored or which file should be uploaded. */ - struct getout { struct getout *next; /* next one */ char *url; /* the URL we deal with */ @@ -98,10 +96,10 @@ struct getout { BIT(noglob); /* disable globbing for this URL */ BIT(out_null); /* discard output for this URL */ }; + /* * 'trace' enumeration represents curl's output look'n feel possibilities. */ - typedef enum { TRACE_NONE, /* no trace/verbose output at all */ TRACE_BIN, /* tcpdump inspired look */ @@ -112,7 +110,6 @@ typedef enum { /* * 'HttpReq' enumeration represents HTTP request types. */ - typedef enum { TOOL_HTTPREQ_UNSPEC, /* first in list */ TOOL_HTTPREQ_GET, @@ -134,7 +131,6 @@ typedef enum { * Complete struct declarations which have OperationConfig struct members, * just in case this header is directly included in some source file. */ - #include "tool_cfgable.h" #endif /* HEADER_CURL_TOOL_SDECLS_H */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 27657657a8..a77c6259eb 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,65 +24,65 @@ # scripts used in test cases TESTSCRIPTS = \ - test1119.pl \ - test1135.pl \ - test1139.pl \ - test1140.pl \ - test1165.pl \ - test1167.pl \ - test1173.pl \ - test1175.pl \ - test1177.pl \ - test1222.pl \ - test1275.pl \ - test1276.pl \ - test1477.pl \ - test1486.pl \ - test1488.pl \ - test1544.pl \ - test1707.pl \ - test745.pl \ - test971.pl + test1119.pl \ + test1135.pl \ + test1139.pl \ + test1140.pl \ + test1165.pl \ + test1167.pl \ + test1173.pl \ + test1175.pl \ + test1177.pl \ + test1222.pl \ + test1275.pl \ + test1276.pl \ + test1477.pl \ + test1486.pl \ + test1488.pl \ + test1544.pl \ + test1707.pl \ + test745.pl \ + test971.pl -EXTRA_DIST = \ - CMakeLists.txt \ - allversions.pm \ - appveyor.pm \ - azure.pm \ - devtest.pl \ - dictserver.py \ - directories.pm \ - ech_combos.py \ - ech_tests.sh \ - ftpserver.pl \ - getpart.pm \ - globalconfig.pm \ - http-server.pl \ - http2-server.pl \ - http3-server.pl \ - memanalyze.pl \ - memanalyzer.pm \ - negtelnetserver.py \ - nghttpx.conf \ - pathhelp.pm \ - processhelp.pm \ - requirements.txt \ - rtspserver.pl \ - runner.pm \ - runtests.pl \ - secureserver.pl \ - serverhelp.pm \ - servers.pm \ - smbserver.py \ - sshhelp.pm \ - sshserver.pl \ - testcurl.pl \ - testutil.pm \ - tftpserver.pl \ - util.py \ - valgrind.pm \ - valgrind.supp \ - $(TESTSCRIPTS) +EXTRA_DIST = \ + CMakeLists.txt \ + allversions.pm \ + appveyor.pm \ + azure.pm \ + devtest.pl \ + dictserver.py \ + directories.pm \ + ech_combos.py \ + ech_tests.sh \ + ftpserver.pl \ + getpart.pm \ + globalconfig.pm \ + http-server.pl \ + http2-server.pl \ + http3-server.pl \ + memanalyze.pl \ + memanalyzer.pm \ + negtelnetserver.py \ + nghttpx.conf \ + pathhelp.pm \ + processhelp.pm \ + requirements.txt \ + rtspserver.pl \ + runner.pm \ + runtests.pl \ + secureserver.pl \ + serverhelp.pm \ + servers.pm \ + smbserver.py \ + sshhelp.pm \ + sshserver.pl \ + testcurl.pl \ + testutil.pm \ + tftpserver.pl \ + util.py \ + valgrind.pm \ + valgrind.supp \ + $(TESTSCRIPTS) # we have two variables here to make sure DIST_SUBDIRS does not get 'unit' # added twice as then targets such as 'distclean' misbehave and try to diff --git a/tests/data/test1292 b/tests/data/test1292 index 9879938b16..24fe1390f1 100644 --- a/tests/data/test1292 +++ b/tests/data/test1292 @@ -29,7 +29,7 @@ http Replaced internal headers with a blank one - -H "Host;" -H "Accept;" http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-H "Host;" -H "Accept;" http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test16 b/tests/data/test16 index 968c072cfd..821cea6716 100644 --- a/tests/data/test16 +++ b/tests/data/test16 @@ -32,7 +32,7 @@ http HTTP with proxy authorization - -U fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong -x %HOSTIP:%HTTPPORT http://we.want.that.site.com/%TESTNUMBER +-U fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong -x %HOSTIP:%HTTPPORT http://we.want.that.site.com/%TESTNUMBER proxy diff --git a/tests/data/test1630 b/tests/data/test1630 index d4a66fef37..24ec4cc954 100644 --- a/tests/data/test1630 +++ b/tests/data/test1630 @@ -33,7 +33,7 @@ https-proxy HTTPS-proxy with Basic auth to HTTP without auth - -U fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong -x https://%HOSTIP:%HTTPSPROXYPORT http://we.want.that.site.com/%TESTNUMBER --proxy-insecure +-U fake@user:loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong -x https://%HOSTIP:%HTTPSPROXYPORT http://we.want.that.site.com/%TESTNUMBER --proxy-insecure proxy diff --git a/tests/data/test2 b/tests/data/test2 index c40b024d38..c29b2646d4 100644 --- a/tests/data/test2 +++ b/tests/data/test2 @@ -28,7 +28,7 @@ http HTTP GET with user and password - -u fake:user http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-u fake:user http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test218 b/tests/data/test218 index 6dd0908867..41bd83818e 100644 --- a/tests/data/test218 +++ b/tests/data/test218 @@ -28,7 +28,7 @@ http HTTP PUT from a file but enforce chunked transfer-encoding - -T %LOGDIR/file%TESTNUMBER -H "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-T %LOGDIR/file%TESTNUMBER -H "Transfer-Encoding: chunked" http://%HOSTIP:%HTTPPORT/%TESTNUMBER just some tiny teeny contents diff --git a/tests/data/test3 b/tests/data/test3 index bc67a289bf..1150214777 100644 --- a/tests/data/test3 +++ b/tests/data/test3 @@ -35,7 +35,7 @@ http HTTP POST with auth and contents but with content-length set to 0 - -d "fooo=mooo%AMPpooo=clue%AMPdoo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-d "fooo=mooo%AMPpooo=clue%AMPdoo=%20%20%20++++" -u "fake:-user" http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test571 b/tests/data/test571 index e59862f88d..258ee6ae68 100644 --- a/tests/data/test571 +++ b/tests/data/test571 @@ -1,9 +1,9 @@ # Bang on RTP by -# 1) giving an evil payload (with $) -# 2) Giving evil content (SDP starting with $) -# 3) packing rtp after headers, after content, and at the start +# 1. giving an evil payload (with $) +# 2. Giving evil content (SDP starting with $) +# 3. packing rtp after headers, after content, and at the start RTSP diff --git a/tests/data/test97 b/tests/data/test97 index e0c6a71018..8b1fad6887 100644 --- a/tests/data/test97 +++ b/tests/data/test97 @@ -28,7 +28,7 @@ http HTTP POST with custom content-type - -d "hejsanallabarn" -H "Content-Type: silly/type" http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-d "hejsanallabarn" -H "Content-Type: silly/type" http://%HOSTIP:%HTTPPORT/%TESTNUMBER diff --git a/tests/data/test98 b/tests/data/test98 index 321e0978b0..880c532c80 100644 --- a/tests/data/test98 +++ b/tests/data/test98 @@ -28,7 +28,7 @@ http HTTP PUT from stdin with set size, disabling chunked transfer-encoding - -T - -H "Transfer-Encoding:" -H "Content-Length: 14" http://%HOSTIP:%HTTPPORT/%TESTNUMBER +-T - -H "Transfer-Encoding:" -H "Content-Length: 14" http://%HOSTIP:%HTTPPORT/%TESTNUMBER data on stdin diff --git a/tests/getpart.pm b/tests/getpart.pm index 03c3dc6287..2aa5aed2e3 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -96,10 +96,10 @@ sub getpartattr { my %hash; my $inside=0; - # print "Section: $section, part: $part\n"; + # print "Section: $section, part: $part\n"; for(@xml) { - # print "$inside: $_"; + # print "$inside: $_"; if(!$inside && ($_ =~ /^ *\<$section/)) { $inside++; } @@ -214,6 +214,7 @@ sub partexists { } return 0; # does not exist } + # The code currently never calls this more than once per part per file, so # caching a result that will never be used again just slows things down. # memoize('partexists', NORMALIZER => 'normalize_part'); # cache each result diff --git a/tests/http/Makefile.am b/tests/http/Makefile.am index a9990be9c3..f5257a377b 100644 --- a/tests/http/Makefile.am +++ b/tests/http/Makefile.am @@ -22,54 +22,54 @@ # ########################################################################### -TESTENV = \ -testenv/__init__.py \ -testenv/caddy.py \ -testenv/certs.py \ -testenv/client.py \ -testenv/curl.py \ -testenv/dante.py \ -testenv/env.py \ -testenv/httpd.py \ -testenv/mod_curltest/mod_curltest.c \ -testenv/nghttpx.py \ -testenv/ports.py \ -testenv/sshd.py \ -testenv/vsftpd.py \ -testenv/ws_echo_server.py +TESTENV = \ + testenv/__init__.py \ + testenv/caddy.py \ + testenv/certs.py \ + testenv/client.py \ + testenv/curl.py \ + testenv/dante.py \ + testenv/env.py \ + testenv/httpd.py \ + testenv/mod_curltest/mod_curltest.c \ + testenv/nghttpx.py \ + testenv/ports.py \ + testenv/sshd.py \ + testenv/vsftpd.py \ + testenv/ws_echo_server.py -EXTRA_DIST = \ -CMakeLists.txt \ -conftest.py \ -requirements.txt \ -scorecard.py \ -test_01_basic.py \ -test_02_download.py \ -test_03_goaway.py \ -test_04_stuttered.py \ -test_05_errors.py \ -test_06_eyeballs.py \ -test_07_upload.py \ -test_08_caddy.py \ -test_09_push.py \ -test_10_proxy.py \ -test_11_unix.py \ -test_12_reuse.py \ -test_13_proxy_auth.py \ -test_14_auth.py \ -test_15_tracing.py \ -test_16_info.py \ -test_17_ssl_use.py \ -test_18_methods.py \ -test_19_shutdown.py \ -test_20_websockets.py \ -test_30_vsftpd.py \ -test_31_vsftpds.py \ -test_32_ftps_vsftpd.py \ -test_40_socks.py \ -test_50_scp.py \ -test_51_sftp.py \ -$(TESTENV) +EXTRA_DIST = \ + CMakeLists.txt \ + conftest.py \ + requirements.txt \ + scorecard.py \ + test_01_basic.py \ + test_02_download.py \ + test_03_goaway.py \ + test_04_stuttered.py \ + test_05_errors.py \ + test_06_eyeballs.py \ + test_07_upload.py \ + test_08_caddy.py \ + test_09_push.py \ + test_10_proxy.py \ + test_11_unix.py \ + test_12_reuse.py \ + test_13_proxy_auth.py \ + test_14_auth.py \ + test_15_tracing.py \ + test_16_info.py \ + test_17_ssl_use.py \ + test_18_methods.py \ + test_19_shutdown.py \ + test_20_websockets.py \ + test_30_vsftpd.py \ + test_31_vsftpds.py \ + test_32_ftps_vsftpd.py \ + test_40_socks.py \ + test_50_scp.py \ + test_51_sftp.py \ + $(TESTENV) clean-local: rm -rf *.pyc __pycache__ diff --git a/tests/libtest/lib562.c b/tests/libtest/lib562.c index 528b2938d3..bc3bcad7e1 100644 --- a/tests/libtest/lib562.c +++ b/tests/libtest/lib562.c @@ -24,11 +24,10 @@ #include "first.h" /* - * From "KNOWN_BUGS" April 2009: - - 59. If the CURLOPT_PORT option is used on an FTP URL like - "ftp://example.com/file;type=A" the ";type=A" is stripped off. + From "KNOWN_BUGS" April 2009: + 59. If the CURLOPT_PORT option is used on an FTP URL like + "ftp://example.com/file;type=A" the ";type=A" is stripped off. */ static CURLcode test_lib562(const char *URL) diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index 2b556a9321..e1b3a8b936 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -72,7 +72,9 @@ /***************************************************************************** * This is a rewrite/clone of the arpa/tftp.h file for systems without it. * *****************************************************************************/ + #define SEGSIZE 512 /* data segment size */ +#define PKTSIZE (SEGSIZE + 4) /* SEGSIZE defined in arpa/tftp.h */ #if defined(__GNUC__) && ((__GNUC__ >= 3) || \ ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7))) @@ -108,8 +110,6 @@ struct tftphdr { * STRUCT DECLARATIONS AND DEFINES * *****************************************************************************/ -#define PKTSIZE (SEGSIZE + 4) /* SEGSIZE defined in arpa/tftp.h */ - struct testcase { char *buffer; /* holds the file data to send to the client */ size_t bufsize; /* size of the data in buffer */ diff --git a/tests/unit/unit1609.c b/tests/unit/unit1609.c index c015354ca2..366b117abe 100644 --- a/tests/unit/unit1609.c +++ b/tests/unit/unit1609.c @@ -35,34 +35,34 @@ static CURLcode t1609_setup(void) /* CURLOPT_RESOLVE address parsing test - to test the following defect fix: - 1) if there is already existing host:port pair in the DNS cache and - we call CURLOPT_RESOLVE, it should also replace addresses. - for example, if there is "test.com:80" with address "1.1.1.1" - and we called CURLOPT_RESOLVE with address "2.2.2.2", then DNS entry needs to - reflect that. + 1. if there is already existing host:port pair in the DNS cache and + we call CURLOPT_RESOLVE, it should also replace addresses. + for example, if there is "test.com:80" with address "1.1.1.1" + and we called CURLOPT_RESOLVE with address "2.2.2.2", then DNS entry + needs to reflect that. - 2) when cached address is already there and close to expire, then by the - time request is made, it can get expired. This happens because, when - we set address using CURLOPT_RESOLVE, - it usually marks as permanent (by setting timestamp to zero). However, - if address already exists -in the cache, then it does not mark it, but just leaves it as it is. - So we fixing this by timestamp to zero if address already exists too. + 2. when cached address is already there and close to expire, then by the + time request is made, it can get expired. This happens because, when + we set address using CURLOPT_RESOLVE, + it usually marks as permanent (by setting timestamp to zero). However, + if address already exists + in the cache, then it does not mark it, but just leaves it as it is. + So we fixing this by timestamp to zero if address already exists too. -Test: + Test: - - insert new entry - - verify that timestamp is not zero - - call set options with CURLOPT_RESOLVE - - then, call Curl_loadhostpairs + - insert new entry + - verify that timestamp is not zero + - call set options with CURLOPT_RESOLVE + - then, call Curl_loadhostpairs - expected result: cached address has zero timestamp. + expected result: cached address has zero timestamp. - - call set options with CURLOPT_RESOLVE with same host:port pair, - different address. - - then, call Curl_loadhostpairs + - call set options with CURLOPT_RESOLVE with same host:port pair, + different address. + - then, call Curl_loadhostpairs - expected result: cached address has zero timestamp and new address + expected result: cached address has zero timestamp and new address */ static CURLcode test_unit1609(const char *arg) diff --git a/tests/unit/unit3211.c b/tests/unit/unit3211.c index 2292d0ed7f..0d8bdf3487 100644 --- a/tests/unit/unit3211.c +++ b/tests/unit/unit3211.c @@ -63,8 +63,7 @@ static void check_set(const char *name, uint32_t capacity, for(i = 1; i < slen; ++i) { fail_unless(Curl_uint32_bset_next(&bset, n, &n), "next failed"); if(n != s[i]) { - curl_mfprintf(stderr, "expected next to be %u" - ", not %u\n", s[i], n); + curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); fail_unless(n == s[i], "next not correct number"); } } diff --git a/tests/unit/unit3213.c b/tests/unit/unit3213.c index 7f62f2b66a..e9b336911c 100644 --- a/tests/unit/unit3213.c +++ b/tests/unit/unit3213.c @@ -60,8 +60,7 @@ static void check_spbset(const char *name, const uint32_t *s, size_t slen) for(i = 1; i < slen; ++i) { fail_unless(Curl_uint32_spbset_next(&bset, n, &n), "next failed"); if(n != s[i]) { - curl_mfprintf(stderr, "expected next to be %u" - ", not %u\n", s[i], n); + curl_mfprintf(stderr, "expected next to be %u, not %u\n", s[i], n); fail_unless(n == s[i], "next not correct number"); } }