]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tidy-up: miscellaneous
authorViktor Szakats <commit@vsz.me>
Mon, 9 Mar 2026 11:27:12 +0000 (12:27 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 13 Apr 2026 23:08:32 +0000 (01:08 +0200)
- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000

148 files changed:
.clang-tidy.yml
.github/workflows/http3-linux.yml
.github/workflows/linux.yml
CMake/PickyWarnings.cmake
docs/INSTALL-CMAKE.md
docs/examples/debug.c
docs/examples/multi-debugcallback.c
docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md
lib/asyn-ares.c
lib/asyn-thrdd.c
lib/asyn.h
lib/cf-dns.c
lib/cf-dns.h
lib/cf-h2-proxy.c
lib/cf-ip-happy.c
lib/cf-socket.c
lib/config-os400.h
lib/config-win32.h
lib/cookie.c
lib/cookie.h
lib/curl_ctype.h
lib/curl_gssapi.c
lib/curl_ntlm_core.c
lib/curl_setup.h
lib/curl_sha512_256.c
lib/curl_threads.c
lib/curl_threads.h
lib/dict.c
lib/dnscache.c
lib/dnscache.h
lib/doh.c
lib/easy_lock.h
lib/easygetopt.c
lib/ftp.c
lib/ftplistparser.c
lib/hash.c
lib/hash.h
lib/hmac.c
lib/hostip.c
lib/hostip.h
lib/hostip4.c
lib/http.c
lib/http.h
lib/http2.c
lib/http_aws_sigv4.c
lib/http_chunks.c
lib/httpsrr.c
lib/httpsrr.h
lib/idn.c
lib/md4.c
lib/md5.c
lib/mime.c
lib/mprintf.c
lib/multi.c
lib/progress.c
lib/protocol.c
lib/request.h
lib/rtsp.c
lib/select.c
lib/select.h
lib/sendf.c
lib/setup-os400.h
lib/sha256.c
lib/socketpair.h
lib/socks_gssapi.c
lib/telnet.c
lib/uint-spbset.c
lib/uint-table.c
lib/url.c
lib/url.h
lib/urlapi-int.h
lib/urldata.h
lib/version.c
lib/vssh/libssh.c
lib/vssh/libssh2.c
lib/vtls/keylog.c
lib/vtls/openssl.c
lib/vtls/schannel.c
lib/vtls/vtls.c
lib/vtls/x509asn1.c
m4/curl-functions.m4
scripts/badwords
scripts/delta
src/tool_cfgable.c
src/tool_findfile.c
src/tool_getparam.c
src/tool_libinfo.c
src/tool_operate.c
src/tool_util.c
tests/libtest/cli_h2_upgrade_extreme.c
tests/libtest/cli_tls_session_reuse.c
tests/libtest/lib1560.c
tests/libtest/lib1965.c
tests/libtest/lib3102.c
tests/libtest/lib517.c
tests/libtest/mk-lib1521.pl
tests/libtest/test1013.pl
tests/libtest/test1022.pl
tests/pathhelp.pm
tests/runner.pm
tests/servers.pm
tests/sshserver.pl
tests/test1119.pl
tests/test1167.pl
tests/tunit/tool1394.c
tests/tunit/tool1604.c
tests/tunit/tool1621.c
tests/tunit/tool1622.c
tests/tunit/tool1623.c
tests/unit/unit1300.c
tests/unit/unit1302.c
tests/unit/unit1303.c
tests/unit/unit1304.c
tests/unit/unit1307.c
tests/unit/unit1309.c
tests/unit/unit1397.c
tests/unit/unit1399.c
tests/unit/unit1600.c
tests/unit/unit1601.c
tests/unit/unit1602.c
tests/unit/unit1603.c
tests/unit/unit1605.c
tests/unit/unit1607.c
tests/unit/unit1609.c
tests/unit/unit1610.c
tests/unit/unit1611.c
tests/unit/unit1612.c
tests/unit/unit1614.c
tests/unit/unit1615.c
tests/unit/unit1620.c
tests/unit/unit1625.c
tests/unit/unit1626.c
tests/unit/unit1627.c
tests/unit/unit1651.c
tests/unit/unit1652.c
tests/unit/unit1654.c
tests/unit/unit1656.c
tests/unit/unit1657.c
tests/unit/unit1658.c
tests/unit/unit1660.c
tests/unit/unit2601.c
tests/unit/unit2602.c
tests/unit/unit2603.c
tests/unit/unit3205.c
tests/unit/unit3212.c
tests/unit/unit3213.c
tests/unit/unit3214.c
tests/unit/unit3216.c

index 411bc70002f610048ace4f06d233269304aea97b..0a1aee8e49b33350bb22cc57fcbb373865dc4208 100644 (file)
@@ -8,7 +8,7 @@
 Checks:
   - clang-analyzer-*
   - -clang-analyzer-optin.performance.Padding
-  - -clang-analyzer-security.ArrayBound  # due to false positives with clang-tidy v21.1.0
+  - -clang-analyzer-security.ArrayBound  # due to false positives with clang-tidy v21.1.0+
   - -clang-analyzer-security.insecureAPI.bzero  # for FD_ZERO() (seen on macOS)
   - -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
   - -clang-diagnostic-nullability-extension
index ee78ff14af90dff34b5d4b9be06dddae86f0c1cd..f70285e302211b861151e338c7ace34de1f6ee1a 100644 (file)
@@ -427,7 +427,8 @@ jobs:
           - name: 'openssl4'
             install_steps: skipall
             LDFLAGS: -Wl,-rpath,/home/runner/openssl4/build/lib
-            PKG_CONFIG_PATH: "/home/runner/openssl4/build/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/runner/openssl4/build/lib/pkgconfig:\
               /home/runner/nghttp3/build/lib/pkgconfig:\
               /home/runner/nghttp2-openssl4/build/lib/pkgconfig"
             configure: >-
@@ -435,7 +436,8 @@ jobs:
 
           - name: 'openssl4'
             tflags: '--min=1640'
-            PKG_CONFIG_PATH: "/home/runner/openssl4/build/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/runner/openssl4/build/lib/pkgconfig:\
               /home/runner/nghttp3/build/lib/pkgconfig:\
               /home/runner/ngtcp2-openssl4/build/lib/pkgconfig:\
               /home/runner/nghttp2/build/lib/pkgconfig"
@@ -483,7 +485,8 @@ jobs:
 
           - name: 'boringssl'
             tflags: '--min=1790'
-            PKG_CONFIG_PATH: "/home/runner/boringssl/build/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/runner/boringssl/build/lib/pkgconfig:\
               /home/runner/nghttp3/build/lib/pkgconfig:\
               /home/runner/ngtcp2-boringssl/build/lib/pkgconfig:\
               /home/runner/nghttp2/build/lib/pkgconfig"
@@ -503,7 +506,8 @@ jobs:
             install_packages: libp11-kit-dev libssh-dev
             tflags: '--min=1840'
             LDFLAGS: -Wl,-rpath,/home/runner/gnutls/build/lib
-            PKG_CONFIG_PATH: "/home/runner/nettle/build/lib64/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/runner/nettle/build/lib64/pkgconfig:\
               /home/runner/gnutls/build/lib/pkgconfig:\
               /home/runner/nghttp3/build/lib/pkgconfig:\
               /home/runner/ngtcp2/build/lib/pkgconfig:\
index d528a91003524cc12497f53324d0a0dcb12064d6..17560ac041a284e8aced2e4e9dff97876783e4d0 100644 (file)
@@ -309,7 +309,8 @@ jobs:
               -Wl,-rpath,/home/runner/rustls/lib
               -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/gsasl/lib
 
-            PKG_CONFIG_PATH: "/home/runner/wolfssl-opensslextra/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/runner/wolfssl-opensslextra/lib/pkgconfig:\
               /home/runner/mbedtls/lib/pkgconfig:\
               /home/runner/rustls/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/gsasl/lib/pkgconfig"
@@ -330,7 +331,8 @@ jobs:
               -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/libnghttp3/lib
               -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
 
-            PKG_CONFIG_PATH: "/home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
             generate: >-
@@ -354,7 +356,8 @@ jobs:
             CC: clang-20
             CFLAGS: -fsanitize=address,undefined,signed-integer-overflow -fno-sanitize-recover=undefined,integer -Wformat -Werror=format-security -Werror=array-bounds -g
             LDFLAGS: -fsanitize=address,undefined -fno-sanitize-recover=undefined,integer -ldl -lubsan -Wl,-rpath,/home/linuxbrew/.linuxbrew/opt/c-ares/lib
-            PKG_CONFIG_PATH: "/home/linuxbrew/.linuxbrew/opt/libssh2/lib/pkgconfig:\
+            PKG_CONFIG_PATH: "\
+              /home/linuxbrew/.linuxbrew/opt/libssh2/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/libngtcp2/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/libnghttp3/lib/pkgconfig:\
               /home/linuxbrew/.linuxbrew/opt/c-ares/lib/pkgconfig"
index 2cd54190e9b2ba83b6d66f9c08388e4319c2b7b0..aca79ec947b75b07310b9410fc414d2b2c8ab739 100644 (file)
@@ -350,7 +350,7 @@ if(PICKY_COMPILER)
       endif()
     endif()
 
-    #
+    # Assemble list of flags
 
     set(_picky_skipped "")
     foreach(_ccopt IN LISTS _picky_enable)
index a4359482dcaaa1e8c5f84a1b5d88d6e3183c92e4..a84faf72f20926c497bdf0863e1efb2ea1841f75 100644 (file)
@@ -247,7 +247,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
 - `SHARE_LIB_OBJECT`:                       Build shared and static libcurl in a single pass (requires CMake 3.12 or newer). Default: `ON` for Windows
 - `STATIC_LIB_SUFFIX`:                      Static library suffix. Default: (empty)
 
-## CA bundle options
+## Root CA options
 
 - `CURL_CA_BUNDLE`:                         Absolute path to the CA bundle. Set `none` to disable or `auto` for auto-detection. Default: `auto`
 - `CURL_CA_EMBED`:                          Absolute path to the CA bundle to embed in the curl tool. Default: (disabled)
@@ -257,6 +257,7 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
 - `CURL_CA_PATH`:                           Absolute path to a directory containing CA certificates stored individually.
                                             Set `none` to disable or `auto` for auto-detection. Default: `auto`
 - `CURL_CA_SEARCH_SAFE`:                    Enable safe CA bundle search (within the curl tool directory) on Windows. Default: `OFF`
+- `USE_APPLE_SECTRUST`:                     Use Apple OS-native certificate verification. Default: `OFF`
 
 ## Enabling features
 
@@ -267,9 +268,12 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
 - `ENABLE_THREADED_RESOLVER`:               Enable threaded DNS lookup. Default: `ON` if c-ares is not enabled and target supports threading.
 - `ENABLE_UNICODE`:                         Use the Unicode version of the Windows API functions. Default: `OFF`
 - `ENABLE_UNIX_SOCKETS`:                    Enable Unix domain sockets support. Default: `ON`
+- `USE_APPLE_IDN`:                          Use Apple built-in IDN support. Default: `OFF`
 - `USE_ECH`:                                Enable ECH support. Default: `OFF`
 - `USE_HTTPSRR`:                            Enable HTTPS RR support. Default: `OFF`
 - `USE_SSLS_EXPORT`:                        Enable experimental SSL session import/export. Default: `OFF`
+- `USE_WIN32_IDN`:                          Use WinIDN for IDN support. Default: `OFF`
+- `USE_WIN32_LDAP`:                         Use Windows LDAP implementation. Default: `ON`
 
 ## Disabling features
 
@@ -369,14 +373,10 @@ Details via CMake
 - `CURL_ZLIB`:                              Use zlib (`ON`, `OFF` or `AUTO`). Default: `AUTO`
 - `CURL_ZSTD`:                              Use zstd (`ON`, `OFF` or `AUTO`). Default: `AUTO`
 - `ENABLE_ARES`:                            Enable c-ares support. Default: `OFF`
-- `USE_APPLE_IDN`:                          Use Apple built-in IDN support. Default: `OFF`
-- `USE_APPLE_SECTRUST`:                     Use Apple OS-native certificate verification. Default: `OFF`
 - `USE_LIBIDN2`:                            Use libidn2 for IDN support. Default: `ON`
 - `USE_NGHTTP2`:                            Use nghttp2 library. Default: `ON`
 - `USE_NGTCP2`:                             Use ngtcp2 and nghttp3 libraries for HTTP/3 support. Default: `OFF`
 - `USE_QUICHE`:                             Use quiche library for HTTP/3 support. Default: `OFF`
-- `USE_WIN32_IDN`:                          Use WinIDN for IDN support. Default: `OFF`
-- `USE_WIN32_LDAP`:                         Use Windows LDAP implementation. Default: `ON`
 
 ## Dependency options (via CMake)
 
index 44156cd8237dc7b5f0e9c1c20a27f67b6b83302b..449cd1111b856b9fb3c3548763d602c28ddfb8d9 100644 (file)
@@ -45,7 +45,7 @@ static void dump(const char *text, const unsigned char *ptr,
     /* without the hex output, we can fit more on screen */
     width = 0x40;
 
-  fprintf(stderr, "%s, %10.10lu bytes (0x%8.8lx)\n",
+  fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
           text, (unsigned long)size, (unsigned long)size);
 
   for(i = 0; i < size; i += width) {
index f56c2877733e78dfe36552ecbb7c54e1cd860ef4..0885486ea92732262016af0bc45af95ea9dd9989 100644 (file)
@@ -42,7 +42,7 @@ static void dump(const char *text, const unsigned char *ptr,
     /* without the hex output, we can fit more on screen */
     width = 0x40;
 
-  fprintf(stderr, "%s, %10.10lu bytes (0x%8.8lx)\n",
+  fprintf(stderr, "%s, %lu bytes (0x%lx)\n",
           text, (unsigned long)size, (unsigned long)size);
 
   for(i = 0; i < size; i += width) {
index 6316c68bcbb198a95d2ee3e8eea37697f35904c4..b1d0dd872c462dc6aed8d64261fe950c1266e87e 100644 (file)
@@ -118,7 +118,7 @@ static void dump(const char *text,
   size_t c;
   unsigned int width = 0x10;
 
-  fprintf(stream, "%s, %10.10ld bytes (0x%8.8lx)\n",
+  fprintf(stream, "%s, %lu bytes (0x%lx)\n",
           text, (long)size, (long)size);
 
   for(i = 0; i < size; i += width) {
index 50a67051c0e6aa73125652977ca139e9392423b0..2bf1d3c3b5c3c32cc10c34e10fb5234953ff5c24 100644 (file)
@@ -208,7 +208,7 @@ static void async_ares_cleanup(struct Curl_resolv_async *async)
 }
 
 void Curl_async_ares_shutdown(struct Curl_easy *data,
-                             struct Curl_resolv_async *async)
+                              struct Curl_resolv_async *async)
 {
   /* c-ares has a method to "cancel" operations on a channel, but
    * as reported in #18216, this does not totally reset the channel
@@ -330,10 +330,10 @@ static timediff_t async_ares_poll_timeout(struct async_ares_ctx *ares,
   int itimeout_ms;
 
 #if TIMEDIFF_T_MAX > INT_MAX
-    itimeout_ms = (timeout_ms > INT_MAX) ? INT_MAX :
-                   ((timeout_ms < 0) ? -1 : (int)timeout_ms);
+  itimeout_ms = (timeout_ms > INT_MAX) ? INT_MAX :
+                 ((timeout_ms < 0) ? -1 : (int)timeout_ms);
 #else
-    itimeout_ms = (int)timeout_ms;
+  itimeout_ms = (int)timeout_ms;
 #endif
   max_timeout.tv_sec = itimeout_ms / 1000;
   max_timeout.tv_usec = (itimeout_ms % 1000) * 1000;
@@ -349,9 +349,10 @@ static timediff_t async_ares_poll_timeout(struct async_ares_ctx *ares,
     return 1000;
 }
 
-static const struct Curl_addrinfo *
-async_ares_get_ai(const struct Curl_addrinfo *ai,
-                  int ai_family, unsigned int index)
+static const struct Curl_addrinfo *async_ares_get_ai(
+  const struct Curl_addrinfo *ai,
+  int ai_family,
+  unsigned int index)
 {
   unsigned int i = 0;
   for(i = 0; ai; ai = ai->ai_next) {
@@ -364,10 +365,10 @@ async_ares_get_ai(const struct Curl_addrinfo *ai,
   return NULL;
 }
 
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
-                  struct Curl_resolv_async *async,
-                  int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+                                              struct Curl_resolv_async *async,
+                                              int ai_family,
+                                              unsigned int index)
 {
   struct async_ares_ctx *ares = &async->ares;
 
@@ -388,9 +389,9 @@ Curl_async_get_ai(struct Curl_easy *data,
 }
 
 #ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
-                     struct Curl_resolv_async *async)
+const struct Curl_https_rrinfo *Curl_async_get_https(
+  struct Curl_easy *data,
+  struct Curl_resolv_async *async)
 {
   if(Curl_async_knows_https(data, async))
     return &async->ares.hinfo;
@@ -415,7 +416,7 @@ bool Curl_async_knows_https(struct Curl_easy *data,
  * Waits for a resolve to finish. This function should be avoided since using
  * this risk getting the multi interface to "hang".
  *
- * 'entry' MUST be non-NULL.
+ * 'pdns' MUST be non-NULL.
  *
  * Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved,
  * CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors.
@@ -479,8 +480,8 @@ CURLcode Curl_async_await(struct Curl_easy *data, uint32_t resolv_id,
  * async_ares_node2addr() converts an address list provided by c-ares
  * to an internal libcurl compatible list.
  */
-static struct Curl_addrinfo *
-async_ares_node2addr(struct ares_addrinfo_node *node)
+static struct Curl_addrinfo *async_ares_node2addr(
+  struct ares_addrinfo_node *node)
 {
   /* traverse the ares_addrinfo_node list */
   struct ares_addrinfo_node *ai;
index cb589b45cc4760bc16aef8d60425767d8c53d115..6fe4ffeb02b3cd3c85eae554cbf814391f8de34b 100644 (file)
@@ -135,11 +135,11 @@ static void async_thrdd_item_destroy(struct async_thrdd_item *item)
 }
 
 /* Initialize context for threaded resolver */
-static struct async_thrdd_item *
-async_thrdd_item_create(struct Curl_easy *data,
-                        uint32_t resolv_id, uint8_t dns_queries,
-                        const char *hostname, uint16_t port,
-                        uint8_t transport)
+static struct async_thrdd_item *async_thrdd_item_create(
+  struct Curl_easy *data,
+  uint32_t resolv_id, uint8_t dns_queries,
+  const char *hostname, uint16_t port,
+  uint8_t transport)
 {
   size_t hostlen = strlen(hostname);
   struct async_thrdd_item *item;
@@ -252,7 +252,7 @@ static CURLcode async_rr_start(struct Curl_easy *data,
 #endif
 
 void Curl_async_thrdd_shutdown(struct Curl_easy *data,
-                              struct Curl_resolv_async *async)
+                               struct Curl_resolv_async *async)
 {
   Curl_async_thrdd_destroy(data, async);
 }
@@ -389,13 +389,13 @@ static void async_thrdd_item_process(void *item)
   struct async_thrdd_item *item = arg;
 
 #ifdef DEBUGBUILD
-    if(item->delay_ms) {
-      curlx_wait_ms(item->delay_ms);
-    }
-    if(item->delay_fail_ms) {
-      curlx_wait_ms(item->delay_fail_ms);
-      return;
-    }
+  if(item->delay_ms) {
+    curlx_wait_ms(item->delay_ms);
+  }
+  if(item->delay_fail_ms) {
+    curlx_wait_ms(item->delay_fail_ms);
+    return;
+  }
 #endif
   item->res = Curl_ipv4_resolve_r(item->hostname, item->port);
   if(!item->res) {
@@ -496,10 +496,9 @@ static void async_thrdd_report_item(struct Curl_easy *data,
     }
   }
 
-  infof(data, "Host %s:%u resolved IPv%c: %s",
-               item->hostname, item->port,
-               (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
-               (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
+  infof(data, "Host %s:%u resolved IPv%c: %s", item->hostname, item->port,
+        (item->dns_queries & CURL_DNSQ_AAAA) ? '6' : '4',
+        (curlx_dyn_len(&tmp) ? curlx_dyn_ptr(&tmp) : "(none)"));
 out:
   curlx_dyn_free(&tmp);
 }
@@ -758,9 +757,9 @@ out:
   return result;
 }
 
-static const struct Curl_addrinfo *
-async_thrdd_get_ai(const struct Curl_addrinfo *ai,
-                   int ai_family, unsigned int index)
+static const struct Curl_addrinfo *async_thrdd_get_ai(
+  const struct Curl_addrinfo *ai,
+  int ai_family, unsigned int index)
 {
   unsigned int i = 0;
   for(i = 0; ai; ai = ai->ai_next) {
@@ -773,10 +772,10 @@ async_thrdd_get_ai(const struct Curl_addrinfo *ai,
   return NULL;
 }
 
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
-                  struct Curl_resolv_async *async,
-                  int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+                                              struct Curl_resolv_async *async,
+                                              int ai_family,
+                                              unsigned int index)
 {
   struct async_thrdd_ctx *thrdd = &async->thrdd;
 
@@ -797,9 +796,9 @@ Curl_async_get_ai(struct Curl_easy *data,
 }
 
 #ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
-                     struct Curl_resolv_async *async)
+const struct Curl_https_rrinfo *Curl_async_get_https(
+  struct Curl_easy *data,
+  struct Curl_resolv_async *async)
 {
 #ifdef USE_HTTPSRR_ARES
   if(Curl_async_knows_https(data, async))
index 41f588b51f4a108806ba014db0603b3a72653a47..06387a85aebc4f6eb0cd6fca31c4e1895ef72c2b 100644 (file)
@@ -82,15 +82,15 @@ void Curl_async_global_cleanup(void);
 CURLcode Curl_async_getaddrinfo(struct Curl_easy *data,
                                 struct Curl_resolv_async *async);
 
-const struct Curl_addrinfo *
-Curl_async_get_ai(struct Curl_easy *data,
-                  struct Curl_resolv_async *async,
-                  int ai_family, unsigned int index);
+const struct Curl_addrinfo *Curl_async_get_ai(struct Curl_easy *data,
+                                              struct Curl_resolv_async *async,
+                                              int ai_family,
+                                              unsigned int index);
 
 #ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_async_get_https(struct Curl_easy *data,
-                     struct Curl_resolv_async *async);
+const struct Curl_https_rrinfo *Curl_async_get_https(
+  struct Curl_easy *data,
+  struct Curl_resolv_async *async);
 bool Curl_async_knows_https(struct Curl_easy *data,
                             struct Curl_resolv_async *async);
 #endif /* USE_HTTPSRR */
@@ -125,7 +125,7 @@ struct async_ares_ctx {
 };
 
 void Curl_async_ares_shutdown(struct Curl_easy *data,
-                             struct Curl_resolv_async *async);
+                              struct Curl_resolv_async *async);
 void Curl_async_ares_destroy(struct Curl_easy *data,
                              struct Curl_resolv_async *async);
 
@@ -176,7 +176,7 @@ struct doh_probes;
  * Waits for a resolve to finish. This function should be avoided since using
  * this risk getting the multi interface to "hang".
  *
- * On return 'entry' is assigned the resolved dns (CURLE_OK or NULL otherwise.
+ * On return 'dns' is assigned the resolved dns (CURLE_OK or NULL otherwise.
  *
  * Returns CURLE_COULDNT_RESOLVE_HOST if the host was not resolved,
  * CURLE_OPERATION_TIMEDOUT if a time-out occurred, or other errors.
@@ -210,8 +210,8 @@ CURLcode Curl_async_pollset(struct Curl_easy *data,
 /* convert these functions if an asynch resolver is not used */
 #define Curl_async_global_init()        CURLE_OK
 #define Curl_async_global_cleanup()     Curl_nop_stmt
-#define Curl_async_get_ai(a,b,c,d)      NULL
-#define Curl_async_await(a,b,c)         CURLE_COULDNT_RESOLVE_HOST
+#define Curl_async_get_ai(a, b, c, d)   NULL
+#define Curl_async_await(a, b, c)       CURLE_COULDNT_RESOLVE_HOST
 #define Curl_async_take_result(x, y, z) CURLE_COULDNT_RESOLVE_HOST
 #define Curl_async_pollset(x, y, z)     CURLE_OK
 #endif /* !CURLRES_ASYNCH */
@@ -263,7 +263,7 @@ void Curl_async_destroy(struct Curl_easy *data,
                         struct Curl_resolv_async *async);
 
 #else /* !USE_CURL_ASYNC */
-#define Curl_async_shutdown(x,y) Curl_nop_stmt
+#define Curl_async_shutdown(x, y) Curl_nop_stmt
 #endif /* USE_CURL_ASYNC */
 
 /********** end of generic resolver interface functions *****************/
index 436d08a1ed90b2a372d3cbc049489abef939de76..bfa7b30780328fbcc0f5746b05a45d1bc46436df 100644 (file)
@@ -47,11 +47,12 @@ struct cf_dns_ctx {
   char hostname[1];
 };
 
-static struct cf_dns_ctx *
-cf_dns_ctx_create(struct Curl_easy *data, uint8_t dns_queries,
-                  const char *hostname, uint16_t port, uint8_t transport,
-                  bool abstract_unix_socket,
-                  struct Curl_dns_entry *dns)
+static struct cf_dns_ctx *cf_dns_ctx_create(struct Curl_easy *data,
+                                            uint8_t dns_queries,
+                                            const char *hostname,
+                                            uint16_t port, uint8_t transport,
+                                            bool abstract_unix_socket,
+                                            struct Curl_dns_entry *dns)
 {
   struct cf_dns_ctx *ctx;
   size_t hlen = strlen(hostname);
@@ -399,7 +400,7 @@ static CURLcode cf_dns_conn_create(struct Curl_cfilter **pcf,
      * there, thus overriding any defaults that might have been set above. */
     hostname = ehost->name;
     port = conn->bits.conn_to_port ?
-            conn->conn_to_port : (uint16_t)conn->remote_port;
+      conn->conn_to_port : (uint16_t)conn->remote_port;
   }
 
   if(!hostname) {
@@ -500,9 +501,10 @@ CURLcode Curl_conn_dns_result(struct connectdata *conn, int sockindex)
   return Curl_cf_dns_result(conn->cfilter[sockindex]);
 }
 
-static const struct Curl_addrinfo *
-cf_dns_get_nth_ai(struct Curl_cfilter *cf, const struct Curl_addrinfo *ai,
-                  int ai_family, unsigned int index)
+static const struct Curl_addrinfo *cf_dns_get_nth_ai(
+  struct Curl_cfilter *cf,
+  const struct Curl_addrinfo *ai,
+  int ai_family, unsigned int index)
 {
   struct cf_dns_ctx *ctx = cf->ctx;
   unsigned int i = 0;
@@ -551,11 +553,10 @@ bool Curl_conn_dns_has_any_ai(struct Curl_easy *data, int sockindex)
  * first "resolve" filter underneath `cf`. If the DNS resolving is
  * not done yet or if no address for the family exists, returns NULL.
  */
-const struct Curl_addrinfo *
-Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
-                   struct Curl_easy *data,
-                   int ai_family,
-                   unsigned int index)
+const struct Curl_addrinfo *Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
+                                               struct Curl_easy *data,
+                                               int ai_family,
+                                               unsigned int index)
 {
   (void)data;
   for(; cf; cf = cf->next) {
@@ -576,15 +577,12 @@ Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
  * first "resolve" filter at the connection. If the DNS resolving is
  * not done yet or if no address for the family exists, returns NULL.
  */
-const struct Curl_addrinfo *
-Curl_conn_dns_get_ai(struct Curl_easy *data,
-                     int sockindex,
-                     int ai_family,
-                     unsigned int index)
+const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
+                                                 int sockindex, int ai_family,
+                                                 unsigned int index)
 {
   struct connectdata *conn = data->conn;
-  return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data,
-                               ai_family, index);
+  return Curl_cf_dns_get_ai(conn->cfilter[sockindex], data, ai_family, index);
 }
 
 #ifdef USE_HTTPSRR
@@ -592,8 +590,8 @@ Curl_conn_dns_get_ai(struct Curl_easy *data,
  * connection. If the DNS resolving is not done yet or if there
  * is no HTTPS-RR info, returns NULL.
  */
-const struct Curl_https_rrinfo *
-Curl_conn_dns_get_https(struct Curl_easy *data, int sockindex)
+const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
+                                                        int sockindex)
 {
   struct Curl_cfilter *cf = data->conn->cfilter[sockindex];
   for(; cf; cf = cf->next) {
index 24e266f1ddfd4ac84f82fb289692c7f1845eeae5..d9966ae295b4ff53040051bab1af10ee4a07c3de 100644 (file)
@@ -51,28 +51,25 @@ CURLcode Curl_cf_dns_result(struct Curl_cfilter *cf);
  * `Curl_conn_dns_get_ai()`. */
 bool Curl_conn_dns_has_any_ai(struct Curl_easy *data, int sockindex);
 
-const struct Curl_addrinfo *
-Curl_conn_dns_get_ai(struct Curl_easy *data,
-                     int sockindex,
-                     int ai_family,
-                     unsigned int index);
+const struct Curl_addrinfo *Curl_conn_dns_get_ai(struct Curl_easy *data,
+                                                 int sockindex,
+                                                 int ai_family,
+                                                 unsigned int index);
 
-const struct Curl_addrinfo *
-Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
-                   struct Curl_easy *data,
-                   int ai_family,
-                   unsigned int index);
+const struct Curl_addrinfo *Curl_cf_dns_get_ai(struct Curl_cfilter *cf,
+                                               struct Curl_easy *data,
+                                               int ai_family,
+                                               unsigned int index);
 
 #ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_conn_dns_get_https(struct Curl_easy *data, int sockindex);
+const struct Curl_https_rrinfo *Curl_conn_dns_get_https(struct Curl_easy *data,
+                                                        int sockindex);
 bool Curl_conn_dns_resolved_https(struct Curl_easy *data, int sockindex);
 #else
-#define Curl_conn_dns_get_https(a,b)         NULL
-#define Curl_conn_dns_resolved_https(a,b)    TRUE
+#define Curl_conn_dns_get_https(a, b)        NULL
+#define Curl_conn_dns_resolved_https(a, b)   TRUE
 #endif
 
-
 extern struct Curl_cftype Curl_cft_dns;
 
 #endif /* HEADER_CURL_CF_DNS_H */
index 5dcf3112eda36c8b4d86ffabae0e6cf78646d7ab..4dd4f4ab35b751c0183791a7eed950f8c18c29a5 100644 (file)
@@ -685,15 +685,16 @@ static int proxy_h2_on_stream_close(nghttp2_session *session,
   return 0;
 }
 
-static CURLcode proxy_h2_submit(int32_t *pstream_id,
-                                struct Curl_cfilter *cf,
-                                struct Curl_easy *data,
-                                nghttp2_session *h2,
-                                struct httpreq *req,
-                                const nghttp2_priority_spec *pri_spec,
-                                void *stream_user_data,
-                               nghttp2_data_source_read_callback read_callback,
-                                void *read_ctx)
+static CURLcode proxy_h2_submit(
+  int32_t *pstream_id,
+  struct Curl_cfilter *cf,
+  struct Curl_easy *data,
+  nghttp2_session *h2,
+  struct httpreq *req,
+  const nghttp2_priority_spec *pri_spec,
+  void *stream_user_data,
+  nghttp2_data_source_read_callback read_callback,
+  void *read_ctx)
 {
   struct dynhds h2_headers;
   nghttp2_nv *nva = NULL;
index c587f66d9433f5cb6d1ccfe6b280f2316251c172..072f9b2c4417b7e6823080e84da68a1e2daf714e 100644 (file)
@@ -123,9 +123,8 @@ static void cf_ai_iter_init(struct cf_ai_iter *iter,
   iter->n = 0;
 }
 
-static const struct Curl_addrinfo *
-cf_ai_iter_next(struct cf_ai_iter *iter,
-                struct Curl_easy *data)
+static const struct Curl_addrinfo *cf_ai_iter_next(struct cf_ai_iter *iter,
+                                                   struct Curl_easy *data)
 {
   const struct Curl_addrinfo *addr;
 
index 6a1057ea9b95d5fb5825a15e85fb7f18ddcf1d20..796c39075ee05f6dbe59d3f20db3c260358466dd 100644 (file)
@@ -100,9 +100,9 @@ static void tcpnodelay(struct Curl_cfilter *cf,
   defined(TCP_KEEPALIVE) || defined(TCP_KEEPALIVE_THRESHOLD) || \
   defined(TCP_KEEPINTVL) || defined(TCP_KEEPALIVE_ABORT_THRESHOLD)
 #if defined(USE_WINSOCK) || \
-   (defined(__sun) && !defined(TCP_KEEPIDLE)) || \
-   (defined(__DragonFly__) && __DragonFly_version < 500702) || \
-   (defined(_WIN32) && !defined(TCP_KEEPIDLE))
+  (defined(__sun) && !defined(TCP_KEEPIDLE)) || \
+  (defined(__DragonFly__) && __DragonFly_version < 500702) || \
+  (defined(_WIN32) && !defined(TCP_KEEPIDLE))
 /* Solaris < 11.4, DragonFlyBSD < 500702 and Windows < 10.0.16299
  * use millisecond units. */
 #define KEEPALIVE_FACTOR(x) ((x) *= 1000)
@@ -638,7 +638,7 @@ static CURLcode bindlocal(struct Curl_easy *data, struct connectdata *conn,
        * to take a type parameter instead.
        */
       uint8_t dns_queries = (af == AF_INET) ?
-                            CURL_DNSQ_A : (CURL_DNSQ_A|CURL_DNSQ_AAAA);
+                            CURL_DNSQ_A : (CURL_DNSQ_A | CURL_DNSQ_AAAA);
 #ifdef USE_IPV6
       if(af == AF_INET6)
         dns_queries = CURL_DNSQ_AAAA;
index 409cbeb6438045a589e0a645911069184b0ac2c0..3d8d59c97e4b173df34551c8b693d4ebe5698e4f 100644 (file)
@@ -30,7 +30,6 @@
 
 #pragma enum(int)
 
-
 /* ---------------------------------------------------------------- */
 /* Global configuration parameters: normally generated by autoconf. */
 /* ---------------------------------------------------------------- */
index f73e2ab0a1814002db643e88162c951884d0cf6d..b1fc1022094eb0e0c3b4354ba030318fa82c68a5 100644 (file)
 
 /* Default define to enable threaded asynchronous DNS lookups. */
 #if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \
-    !defined(USE_RESOLV_THREADED)
+  !defined(USE_RESOLV_THREADED)
 #  define USE_RESOLV_THREADED 1
 #endif
 
 /* ---------------------------------------------------------------- */
 
 #ifndef CURL_WINDOWS_UWP
-#define HAVE_LDAP_SSL 1
+#define HAVE_LDAP_SSL  1
 #define USE_WIN32_LDAP 1
 
 /* Define to use the Windows crypto library. */
index 1516d38f5b89794b4dc0259959610f91f87fa0c9..1e21d1bf754cb7b8ac04a9142b06bd32fe88768d 100644 (file)
@@ -423,18 +423,17 @@ static CURLcode storecookie(struct Cookie *co, struct Curl_str *cp,
 
 /* this function return errors on OOM etc, not on plain cookie format
    problems */
-static CURLcode
-parse_cookie_header(struct Curl_easy *data,
-                    struct Cookie *co,
-                    struct CookieInfo *ci,
-                    bool *okay, /* if the cookie was fine */
-                    const char *ptr,
-                    const char *domain, /* default domain */
-                    const char *path,   /* full path used when this cookie is
-                                           set, used to get default path for
-                                           the cookie unless set */
-                    bool secure)  /* TRUE if connection is over secure
-                                     origin */
+static CURLcode parse_cookie_header(
+  struct Curl_easy *data,
+  struct Cookie *co,
+  struct CookieInfo *ci,
+  bool *okay,         /* if the cookie was fine */
+  const char *ptr,
+  const char *domain, /* default domain */
+  const char *path,   /* full path used when this cookie is
+                         set, used to get default path for
+                         the cookie unless set */
+  bool secure)        /* TRUE if connection is over secure origin */
 {
   /* This line was read off an HTTP-header */
   time_t now = 0;
@@ -930,17 +929,16 @@ static bool replace_existing(struct Curl_easy *data,
  * IPv6 address.
  *
  */
-CURLcode
-Curl_cookie_add(struct Curl_easy *data,
-                struct CookieInfo *ci,
-                bool httpheader, /* TRUE if HTTP header-style line */
-                bool noexpire, /* if TRUE, skip remove_expired() */
-                const char *lineptr,   /* first character of the line */
-                const char *domain, /* default domain */
-                const char *path,   /* full path used when this cookie is set,
-                                       used to get default path for the cookie
-                                       unless set */
-                bool secure)  /* TRUE if connection is over secure origin */
+CURLcode Curl_cookie_add(
+  struct Curl_easy *data,
+  struct CookieInfo *ci,
+  bool httpheader,     /* TRUE if HTTP header-style line */
+  bool noexpire,       /* if TRUE, skip remove_expired() */
+  const char *lineptr, /* first character of the line */
+  const char *domain,  /* default domain */
+  const char *path,    /* full path used when this cookie is set, used
+                          to get default path for the cookie unless set */
+  bool secure)         /* TRUE if connection is over secure origin */
 {
   struct Cookie comem;
   struct Cookie *co;
index fabd04d3989bb9fdb078ef57321f884ca7c699b4..f66e0ef59182d0fb66aca47851de4b1455398d48 100644 (file)
@@ -125,11 +125,11 @@ void Curl_cookie_clearall(struct CookieInfo *ci);
 void Curl_cookie_clearsess(struct CookieInfo *ci);
 
 #if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
-#define Curl_cookie_list(x) NULL
+#define Curl_cookie_list(x)      NULL
 #define Curl_cookie_loadfiles(x) CURLE_OK
-#define Curl_cookie_init() NULL
-#define Curl_cookie_run(x) Curl_nop_stmt
-#define Curl_cookie_cleanup(x) Curl_nop_stmt
+#define Curl_cookie_init()       NULL
+#define Curl_cookie_run(x)       Curl_nop_stmt
+#define Curl_cookie_cleanup(x)   Curl_nop_stmt
 #define Curl_flush_cookies(x, y) Curl_nop_stmt
 #else
 void Curl_flush_cookies(struct Curl_easy *data, bool cleanup);
index 65fe71927b9657aa6fdc9c08c37b3c226696620e..f3291ad8184b61f5e5247cadd628d59dc80ced6e 100644 (file)
@@ -44,9 +44,9 @@
 #define ISDIGIT(x)  (((x) >= '0') && ((x) <= '9'))
 #define ISBLANK(x)  (((x) == ' ') || ((x) == '\t'))
 #define ISSPACE(x)  (ISBLANK(x) || (((x) >= 0xa) && ((x) <= 0x0d)))
-#define ISURLPUNTCS(x) (((x) == '-') || ((x) == '.') || ((x) == '_') || \
-                        ((x) == '~'))
+#define ISURLPUNTCS(x)                                           \
+  (((x) == '-') || ((x) == '.') || ((x) == '_') || ((x) == '~'))
 #define ISUNRESERVED(x) (ISALNUM(x) || ISURLPUNTCS(x))
-#define ISNEWLINE(x) (((x) == '\n') || (x) == '\r')
+#define ISNEWLINE(x)    (((x) == '\n') || (x) == '\r')
 
 #endif /* HEADER_CURL_CTYPE_H */
index 1feb0bf88fc4339eb07617ecd22313baf6c44900..650d1908d0f3b9f1500cf74169c76e3c8811e0d4 100644 (file)
@@ -93,20 +93,20 @@ struct stub_gss_ctx_id_t_desc {
   char creds[250];
 };
 
-static OM_uint32
-stub_gss_init_sec_context(OM_uint32 *min,
-                          gss_cred_id_t initiator_cred_handle,
-                          struct stub_gss_ctx_id_t_desc **context,
-                          gss_name_t target_name,
-                          const gss_OID mech_type,
-                          OM_uint32 req_flags,
-                          OM_uint32 time_req,
-                          const gss_channel_bindings_t input_chan_bindings,
-                          gss_buffer_desc *input_token,
-                          gss_OID *actual_mech_type,
-                          gss_buffer_desc *output_token,
-                          OM_uint32 *ret_flags,
-                          OM_uint32 *time_rec)
+static OM_uint32 stub_gss_init_sec_context(
+  OM_uint32 *min,
+  gss_cred_id_t initiator_cred_handle,
+  struct stub_gss_ctx_id_t_desc **context,
+  gss_name_t target_name,
+  const gss_OID mech_type,
+  OM_uint32 req_flags,
+  OM_uint32 time_req,
+  const gss_channel_bindings_t input_chan_bindings,
+  gss_buffer_desc *input_token,
+  gss_OID *actual_mech_type,
+  gss_buffer_desc *output_token,
+  OM_uint32 *ret_flags,
+  OM_uint32 *time_rec)
 {
   struct stub_gss_ctx_id_t_desc *ctx = NULL;
 
@@ -283,10 +283,10 @@ stub_gss_init_sec_context(OM_uint32 *min,
   return GSS_S_CONTINUE_NEEDED;
 }
 
-static OM_uint32
-stub_gss_delete_sec_context(OM_uint32 *min,
-                            struct stub_gss_ctx_id_t_desc **context,
-                            gss_buffer_t output_token)
+static OM_uint32 stub_gss_delete_sec_context(
+  OM_uint32 *min,
+  struct stub_gss_ctx_id_t_desc **context,
+  gss_buffer_t output_token)
 {
   (void)output_token;
 
index cb538af9184f513d422005c990c74c42d4e9da65..4b2007bbad89cd385b3615bc788daa0eea4e990e 100644 (file)
@@ -141,7 +141,7 @@ static void extend_key_56_to_64(const unsigned char *key_56, char *key)
   key[4] = (char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4));
   key[5] = (char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
   key[6] = (char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
-  key[7] = (char) ((key_56[6] << 1) & 0xFF);
+  key[7] = (char)((key_56[6] << 1) & 0xFF);
 }
 
 #ifdef USE_OPENSSL_DES
index 7930167658cdf8fc7261076bf305e73389822cc6..5668340dd1eced95b824c711b1d1f4a77b67240f 100644 (file)
 #endif
 
 /* based on logic in "curl/mprintf.h" */
-#if (defined(__GNUC__) || defined(__clang__) ||                         \
-  defined(__IAR_SYSTEMS_ICC__)) &&                                      \
-  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) &&         \
+#if (defined(__GNUC__) || defined(__clang__) ||                 \
+     defined(__IAR_SYSTEMS_ICC__)) &&                           \
+  defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \
   !defined(CURL_NO_FMT_CHECKS)
 #if defined(__MINGW32__) && !defined(__clang__)
-#define CURL_PRINTF(fmt, arg) \
-  __attribute__((format(gnu_printf, fmt, arg)))
+#define CURL_PRINTF(fmt, arg) __attribute__((format(gnu_printf, fmt, arg)))
 #else
-#define CURL_PRINTF(fmt, arg) \
-  __attribute__((format(__printf__, fmt, arg)))
+#define CURL_PRINTF(fmt, arg) __attribute__((format(__printf__, fmt, arg)))
 #endif
 #else
 #define CURL_PRINTF(fmt, arg)
    (defined(__GNUC__) && __GNUC__ <= 14)) &&                \
   defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
   !defined(__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__)
-#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__             \
+#define __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ \
   __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
 #endif
 
 #endif
 
 #if defined(USE_GNUTLS) || defined(USE_OPENSSL) || defined(USE_MBEDTLS) || \
-  defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \
-  defined(USE_RUSTLS)
+  defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || defined(USE_RUSTLS)
 #define USE_SSL    /* SSL support has been enabled */
 #endif
 
 #endif
 
 /* Single point where USE_SPNEGO definition might be defined */
-#if !defined(CURL_DISABLE_NEGOTIATE_AUTH) && \
-    (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
+#if !defined(CURL_DISABLE_NEGOTIATE_AUTH) &&          \
+  (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
 #define USE_SPNEGO
 #endif
 
 /* Single point where USE_KERBEROS5 definition might be defined */
-#if !defined(CURL_DISABLE_KERBEROS_AUTH) && \
-    (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
+#if !defined(CURL_DISABLE_KERBEROS_AUTH) &&           \
+  (defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI))
 #define USE_KERBEROS5
 #endif
 
 /* Single point where USE_NTLM definition might be defined */
 #ifdef CURL_ENABLE_NTLM
-#  if (defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT)) ||        \
-  defined(USE_GNUTLS) ||                                                \
-  (defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB)) ||      \
-  defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) ||              \
+#  if (defined(USE_OPENSSL) && defined(HAVE_DES_ECB_ENCRYPT)) ||   \
+  defined(USE_GNUTLS) ||                                           \
+  (defined(USE_MBEDTLS) && defined(HAVE_MBEDTLS_DES_CRYPT_ECB)) || \
+  defined(USE_OS400CRYPTO) || defined(USE_WIN32_CRYPTO) ||         \
   (defined(USE_WOLFSSL) && defined(HAVE_WC_DES_ECBENCRYPT))
 #    define USE_CURL_NTLM_CORE
 #  endif
 /* fallthrough attribute */
 
 #ifndef FALLTHROUGH
-#if (defined(__GNUC__) && __GNUC__ >= 7) || \
-    (defined(__clang__) && __clang_major__ >= 10)
+#if (defined(__GNUC__) && __GNUC__ >= 7) ||     \
+  (defined(__clang__) && __clang_major__ >= 10)
 #  define FALLTHROUGH()  __attribute__((fallthrough))
 #else
 #  define FALLTHROUGH()  do {} while(0)
@@ -1015,7 +1012,7 @@ struct timeval {
  * 'bool' stuff compatible with HP-UX headers.
  */
 #if defined(__hpux) && !defined(HAVE_BOOL_T)
-   typedef int bool;
+typedef int bool;
 #  define false 0
 #  define true 1
 #  define HAVE_BOOL_T
@@ -1028,10 +1025,10 @@ struct timeval {
  * global namespace though, so use bool_false and bool_true.
  */
 #ifndef HAVE_BOOL_T
-  typedef enum {
-    bool_false = 0,
-    bool_true  = 1
-  } bool;
+typedef enum {
+  bool_false = 0,
+  bool_true = 1
+} bool;
 
 /*
  * Use a define to let 'true' and 'false' use those enums. There
index 57779886135026dd2dccff615683c4172ddcdeef..5f5a738b3f092e7b5086bc7d47c814da6bd58d24 100644 (file)
@@ -203,7 +203,7 @@ static CURLcode Curl_sha512_256_update(void *ctx,
                                        size_t length)
 {
   do {
-    word32 ilen = (word32) CURLMIN(length, UINT_MAX);
+    word32 ilen = (word32)CURLMIN(length, UINT_MAX);
     if(wc_Sha512_256Update(ctx, data, ilen))
       return CURLE_SSL_CIPHER;
     length -= ilen;
@@ -291,10 +291,7 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context)
 /* ** This implementation of SHA-512/256 hash calculation was originally ** *
  * ** written by Evgeny Grin (Karlson2k) for GNU libmicrohttpd.          ** *
  * ** The author ported the code to libcurl. The ported code is provided ** *
- * ** under curl license.                                                ** *
- * ** This is a minimal version with minimal optimizations. Performance  ** *
- * ** can be significantly improved. Big-endian store and load macros    ** *
- * ** are obvious targets for optimization.                              ** */
+ * ** under curl license.                                                ** */
 
 #ifdef __GNUC__
 #  if defined(__has_attribute) && defined(__STDC_VERSION__)
index 5f1d47f3d72167754001fc45aebf47b7ac54a191..01041f63c3acb202a0d698f780d5c6668e61e78b 100644 (file)
@@ -47,8 +47,8 @@ static void *curl_thread_create_thunk(void *arg)
   return 0;
 }
 
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
-                                 (CURL_STDCALL *func) (void *), void *arg)
+curl_thread_t Curl_thread_create(
+  CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg)
 {
   curl_thread_t t = curlx_malloc(sizeof(pthread_t));
   struct Curl_actual_call *ac = NULL;
@@ -97,8 +97,8 @@ int Curl_thread_join(curl_thread_t *hnd)
 
 #elif defined(_WIN32)
 
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
-                                 (CURL_STDCALL *func) (void *), void *arg)
+curl_thread_t Curl_thread_create(
+  CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg)
 {
   curl_thread_t t = CreateThread(NULL, 0, func, arg, 0, NULL);
   if(!t) {
@@ -163,13 +163,13 @@ CURLcode Curl_cond_timedwait(pthread_cond_t *c, pthread_mutex_t *m,
    * that will be most likely in the past, as far as POSIX abstime is
    * concerned. */
 #ifdef HAVE_GETTIMEOFDAY
-    struct timeval tv;
-    (void)gettimeofday(&tv, NULL);
-    now.tv_sec = tv.tv_sec;
-    now.tv_usec = (int)tv.tv_usec;
+  struct timeval tv;
+  (void)gettimeofday(&tv, NULL);
+  now.tv_sec = tv.tv_sec;
+  now.tv_usec = (int)tv.tv_usec;
 #else
-    now.tv_sec = time(NULL);
-    now.tv_usec = 0;
+  now.tv_sec = time(NULL);
+  now.tv_usec = 0;
 #endif
 
   ts.tv_sec = now.tv_sec + (timeout_ms / 1000);
index 5a1609a2c99be02b119112d09f1ecbd00950a8ca..081d155695f885cc84f9e0bd534b885c9ee7888f 100644 (file)
@@ -65,8 +65,8 @@ CURLcode Curl_cond_timedwait(curl_cond_t *c, curl_mutex_t *m,
 
 #ifdef USE_THREADS
 
-curl_thread_t Curl_thread_create(CURL_THREAD_RETURN_T
-                                 (CURL_STDCALL *func) (void *), void *arg);
+curl_thread_t Curl_thread_create(
+  CURL_THREAD_RETURN_T(CURL_STDCALL *func)(void *), void *arg);
 
 void Curl_thread_destroy(curl_thread_t *hnd);
 
index 433d1553ec243dbda3c279c7aacefcf9f95df1c2..7b83c6cff1937a6b87308cecbf90bb824a2fb256 100644 (file)
@@ -64,7 +64,6 @@
 #define DICT_DEFINE2 "/D:"
 #define DICT_DEFINE3 "/LOOKUP:"
 
-
 #define DYN_DICT_WORD 10000
 static char *unescape_word(const char *input)
 {
index 9dba448285cb2c83a25164d4f583c97b788a72fa..2129d283cc9ea35b799572b57bc9929a02d812cf 100644 (file)
@@ -329,8 +329,6 @@ static int num_addresses(const struct Curl_addrinfo *addr)
   return i;
 }
 
-UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
-                                    struct Curl_addrinfo **addr);
 /*
  * Curl_shuffle_addr() shuffles the order of addresses in a 'Curl_addrinfo'
  * struct by re-linking its linked list.
@@ -343,6 +341,8 @@ UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
  *
  * @unittest: 1608
  */
+UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
+                                    struct Curl_addrinfo **addr);
 UNITTEST CURLcode Curl_shuffle_addr(struct Curl_easy *data,
                                     struct Curl_addrinfo **addr)
 {
@@ -407,15 +407,15 @@ static bool dnscache_ai_has_family(struct Curl_addrinfo *ai,
   return FALSE;
 }
 
-static struct Curl_dns_entry *
-dnscache_entry_create(struct Curl_easy *data,
-                      uint8_t dns_queries,
-                      struct Curl_addrinfo **paddr1,
-                      struct Curl_addrinfo **paddr2,
-                      const char *hostname,
-                      size_t hostlen,
-                      uint16_t port,
-                      bool permanent)
+static struct Curl_dns_entry *dnscache_entry_create(
+  struct Curl_easy *data,
+  uint8_t dns_queries,
+  struct Curl_addrinfo **paddr1,
+  struct Curl_addrinfo **paddr2,
+  const char *hostname,
+  size_t hostlen,
+  uint16_t port,
+  bool permanent)
 {
   struct Curl_dns_entry *dns = NULL;
 
@@ -488,25 +488,23 @@ out:
   return dns;
 }
 
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry(struct Curl_easy *data,
-                       uint8_t dns_queries,
-                       struct Curl_addrinfo **paddr,
-                       const char *hostname,
-                       uint16_t port)
+struct Curl_dns_entry *Curl_dnscache_mk_entry(struct Curl_easy *data,
+                                              uint8_t dns_queries,
+                                              struct Curl_addrinfo **paddr,
+                                              const char *hostname,
+                                              uint16_t port)
 {
   return dnscache_entry_create(data, dns_queries, paddr, NULL, hostname,
                                hostname ? strlen(hostname) : 0,
                                port, FALSE);
 }
 
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry2(struct Curl_easy *data,
-                        uint8_t dns_queries,
-                        struct Curl_addrinfo **paddr1,
-                        struct Curl_addrinfo **paddr2,
-                        const char *hostname,
-                        uint16_t port)
+struct Curl_dns_entry *Curl_dnscache_mk_entry2(struct Curl_easy *data,
+                                               uint8_t dns_queries,
+                                               struct Curl_addrinfo **paddr1,
+                                               struct Curl_addrinfo **paddr2,
+                                               const char *hostname,
+                                               uint16_t port)
 {
   return dnscache_entry_create(data, dns_queries, paddr1, paddr2, hostname,
                                hostname ? strlen(hostname) : 0,
@@ -530,15 +528,14 @@ void Curl_dns_entry_set_https_rr(struct Curl_dns_entry *dns,
 }
 #endif /* USE_HTTPSRR */
 
-static struct Curl_dns_entry *
-dnscache_add_addr(struct Curl_easy *data,
-                  struct Curl_dnscache *dnscache,
-                  uint8_t dns_queries,
-                  struct Curl_addrinfo **paddr,
-                  const char *hostname,
-                  size_t hlen,
-                  uint16_t port,
-                  bool permanent)
+static struct Curl_dns_entry *dnscache_add_addr(struct Curl_easy *data,
+                                                struct Curl_dnscache *dnscache,
+                                                uint8_t dns_queries,
+                                                struct Curl_addrinfo **paddr,
+                                                const char *hostname,
+                                                size_t hlen,
+                                                uint16_t port,
+                                                bool permanent)
 {
   char entry_id[MAX_HOSTCACHE_LEN];
   size_t entry_len;
index ba5eedb37db3b3f5256b5e5d31806e20f997cb9b..a9f42356c7af9c7aafc138c01f3103803fe2b587 100644 (file)
@@ -57,25 +57,23 @@ struct Curl_dns_entry {
  * Create a `Curl_dns_entry` with a reference count of 1.
  * Use `Curl_dns_entry_unlink()` to release your hold on it.
  *
- * The call takes ownership of `addr`, even in case of failure, and always
+ * The call takes ownership of `paddr`, even in case of failure, and always
  * clears `*paddr`. It makes a copy of `hostname`.
  *
  * Returns entry or NULL on OOM.
  */
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry(struct Curl_easy *data,
-                       uint8_t dns_queries,
-                       struct Curl_addrinfo **paddr,
-                       const char *hostname,
-                       uint16_t port);
-
-struct Curl_dns_entry *
-Curl_dnscache_mk_entry2(struct Curl_easy *data,
-                        uint8_t dns_queries,
-                        struct Curl_addrinfo **paddr1,
-                        struct Curl_addrinfo **paddr2,
-                        const char *hostname,
-                        uint16_t port);
+struct Curl_dns_entry *Curl_dnscache_mk_entry(struct Curl_easy *data,
+                                              uint8_t dns_queries,
+                                              struct Curl_addrinfo **paddr,
+                                              const char *hostname,
+                                              uint16_t port);
+
+struct Curl_dns_entry *Curl_dnscache_mk_entry2(struct Curl_easy *data,
+                                               uint8_t dns_queries,
+                                               struct Curl_addrinfo **paddr1,
+                                               struct Curl_addrinfo **paddr2,
+                                               const char *hostname,
+                                               uint16_t port);
 
 #ifdef USE_HTTPSRR
 void Curl_dns_entry_set_https_rr(struct Curl_dns_entry *dns,
@@ -92,7 +90,6 @@ struct Curl_dns_entry *Curl_dns_entry_link(struct Curl_easy *data,
 void Curl_dns_entry_unlink(struct Curl_easy *data,
                            struct Curl_dns_entry **pdns);
 
-
 struct Curl_dnscache {
   struct Curl_hash entries;
 };
index d287093d99e88a92d000ae333cdae7bbe9bbe401..f152401862cc0aa7400d737de6ca5fd314b67f6d 100644 (file)
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -714,7 +714,7 @@ static DOHcode doh_rdata(const unsigned char *doh,
   return DOH_OK;
 }
 
-UNITTEST void de_init(struct dohentry *d);
+UNITTEST void de_init(struct dohentry *de);
 UNITTEST void de_init(struct dohentry *de)
 {
   int i;
@@ -1117,11 +1117,10 @@ static CURLcode doh_decode_rdata_name(const unsigned char **buf,
   return CURLE_OK;
 }
 
+/* @unittest 1658 */
 UNITTEST CURLcode doh_resp_decode_httpsrr(struct Curl_easy *data,
                                           const unsigned char *cp, size_t len,
                                           struct Curl_https_rrinfo **hrr);
-
-/* @unittest 1658 */
 UNITTEST CURLcode doh_resp_decode_httpsrr(struct Curl_easy *data,
                                           const unsigned char *cp, size_t len,
                                           struct Curl_https_rrinfo **hrr)
index 63c6e93541a4246d891a8f6715d1154859e29572..b8f916ff659c21347ee3c1ae8aa4bfc8ee5c72af 100644 (file)
@@ -49,8 +49,8 @@
    __has_builtin() function, so override it. */
 
 /* if GCC on i386/x86_64 or if the built-in is present */
-#if (defined(__GNUC__) && !defined(__clang__)) &&     \
-    (defined(__i386__) || defined(__x86_64__))
+#if (defined(__GNUC__) && !defined(__clang__)) && \
+  (defined(__i386__) || defined(__x86_64__))
 #define HAVE_BUILTIN_IA32_PAUSE
 #elif defined(__has_builtin)  /* Keep this PP check separate from others */
 #if __has_builtin(__builtin_ia32_pause)
index 2685adae957be6b0dfd28eaa9b180cf090b0f2fb..533d7e3670520fc7dd769d4d75e664c26b0d47ce 100644 (file)
@@ -62,8 +62,8 @@ const struct curl_easyoption *curl_easy_option_by_id(CURLoption id)
 }
 
 /* Iterates over available options */
-const struct curl_easyoption *
-curl_easy_option_next(const struct curl_easyoption *prev)
+const struct curl_easyoption *curl_easy_option_next(
+  const struct curl_easyoption *prev)
 {
   if(prev && prev->name) {
     prev++;
@@ -88,8 +88,8 @@ const struct curl_easyoption *curl_easy_option_by_id(CURLoption id)
   return NULL;
 }
 
-const struct curl_easyoption *
-curl_easy_option_next(const struct curl_easyoption *prev)
+const struct curl_easyoption *curl_easy_option_next(
+  const struct curl_easyoption *prev)
 {
   (void)prev;
   return NULL;
index 980efc3b2bc59dc88e035f8e72df986ee4db1642..318ccab719274ee2a1ed9ebc512b12aee9f6cad2 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -307,7 +307,7 @@ static CURLcode ftp_parse_url_path(struct Curl_easy *data,
     ftpc->file = fileName;
   else
     ftpc->file = NULL; /* instead of point to a zero byte,
-                            we make it a NULL pointer */
+                          we make it a NULL pointer */
 
   if(data->state.upload && !ftpc->file && (ftp->transfer == PPTRANSFER_BODY)) {
     /* We need a filename when uploading. Return error! */
@@ -1686,17 +1686,17 @@ static CURLcode ftp_state_ul_setup(struct Curl_easy *data,
 
   if((data->state.resume_from && !sizechecked) ||
      ((data->state.resume_from > 0) && sizechecked)) {
-    /* we are about to continue the uploading of a file */
-    /* 1. get already existing file's size. We use the SIZE command for this
-       which may not exist in the server!  The SIZE command is not in
-       RFC959. */
+    /* we are about to continue the uploading of a file
+       1. get already existing file's size. We use the SIZE command for this
+          which may not exist in the server!  The SIZE command is not in
+          RFC959.
 
-    /* 2. This used to set REST, but since we can do append, we issue no
-       another ftp command. Skip the source file offset and APPEND the rest on
-       the file instead */
+       2. This used to set REST, but since we can do append, we issue no
+          another ftp command. Skip the source file offset and APPEND the rest
+          on the file instead
 
-    /* 3. pass file-size number of bytes in the source file */
-    /* 4. lower the infilesize counter */
+       3. pass file-size number of bytes in the source file
+       4. lower the infilesize counter */
     /* => transfer as usual */
     int seekerr = CURL_SEEKFUNC_OK;
 
@@ -2507,7 +2507,6 @@ static bool twodigit(const char *p, int *val)
 /*
  * Unittest @1668
  */
-
 UNITTEST bool ftp_213_date(const char *p, int *year, int *month, int *day,
                            int *hour, int *minute, int *second);
 UNITTEST bool ftp_213_date(const char *p, int *year, int *month, int *day,
@@ -3888,12 +3887,12 @@ static CURLcode ftp_nb_type(struct Curl_easy *data,
  * This is the actual DO function for FTP. Get a file/directory according to
  * the options previously setup.
  */
-static
-CURLcode ftp_perform(struct Curl_easy *data,
-                     struct ftp_conn *ftpc,
-                     struct FTP *ftp,
-                     bool *connected,  /* connect status after PASV / PORT */
-                     bool *dophase_done)
+static CURLcode ftp_perform(
+  struct Curl_easy *data,
+  struct ftp_conn *ftpc,
+  struct FTP *ftp,
+  bool *connected,  /* connect status after PASV / PORT */
+  bool *dophase_done)
 {
   /* this is FTP and no proxy */
   CURLcode result = CURLE_OK;
index f53c68aa72fbb5416da76f703ac26759aa20714d..b5d9338c1bc29e0e8996211fcf72cb35acdae5cf 100644 (file)
@@ -325,8 +325,7 @@ static CURLcode ftp_pl_insert_finfo(struct Curl_easy *data,
 
   /* filter pattern-corresponding filenames */
   Curl_set_in_callback(data, TRUE);
-  if(compare(data->set.fnmatch_data, wc->pattern,
-             finfo->filename) == 0) {
+  if(compare(data->set.fnmatch_data, wc->pattern, finfo->filename) == 0) {
     /* discard symlink which is containing multiple " -> " */
     if((finfo->filetype == CURLFILETYPE_SYMLINK) && finfo->strings.target &&
        (strstr(finfo->strings.target, " -> "))) {
index 67879d8b5724caa712ddee0fbcf5aa3b98bcbc62..3eae1d26a7919cbc161830237450fc809496e13b 100644 (file)
@@ -359,8 +359,8 @@ void Curl_hash_start_iterate(struct Curl_hash *hash,
 #endif
 }
 
-struct Curl_hash_element *
-Curl_hash_next_element(struct Curl_hash_iterator *iter)
+struct Curl_hash_element *Curl_hash_next_element(
+  struct Curl_hash_iterator *iter)
 {
   struct Curl_hash *h;
   DEBUGASSERT(iter->init == ITERINIT);
index 267f91d1ae43cc3d9493df25b215d1d4e136ef37..1d7d3de8cecdbb701652bf5d177cf6fc769b7e50 100644 (file)
@@ -97,8 +97,8 @@ size_t curlx_str_key_compare(void *k1, size_t key1_len, void *k2,
                              size_t key2_len);
 void Curl_hash_start_iterate(struct Curl_hash *hash,
                              struct Curl_hash_iterator *iter);
-struct Curl_hash_element *
-Curl_hash_next_element(struct Curl_hash_iterator *iter);
+struct Curl_hash_element *Curl_hash_next_element(
+  struct Curl_hash_iterator *iter);
 
 void Curl_hash_print(struct Curl_hash *h, void (*func)(void *));
 
index 6ae934d5474ce74dd1a6e3247e41117e83473a88..a4d6ebdd8a64e853f7ffb58945b28d77a4f0630b 100644 (file)
@@ -25,8 +25,8 @@
  ***************************************************************************/
 #include "curl_setup.h"
 
-#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) ||      \
-  !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) ||   \
+#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) ||    \
+  !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \
   defined(USE_SSL)
 
 #include "curl_hmac.h"
@@ -155,7 +155,7 @@ CURLcode Curl_hmacit(const struct HMAC_params *hashparams,
 
   /* Update the digest with the given challenge */
   do {
-    unsigned int ilen = (unsigned int) CURLMIN(datalen, UINT_MAX);
+    unsigned int ilen = (unsigned int)CURLMIN(datalen, UINT_MAX);
     Curl_HMAC_update(ctxt, data, ilen);
     datalen -= ilen;
     data += ilen;
index 87896cc5d66e46bf4970a74cf19294ba927c1cf5..d6052a45f8cd7f1280d6eb7d67679a197379303f 100644 (file)
  * CURLRES_* defines based on the config*.h and curl_setup.h defines.
  */
 
-/*
- * Curl_printable_address() stores a printable version of the 1st address
- * given in the 'ai' argument. The result will be stored in the buf that is
- * bufsize bytes big.
- *
- * If the conversion fails, the target buffer is empty.
- */
-
 uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
 {
   (void)data;
@@ -129,7 +121,7 @@ uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
     return CURL_DNSQ_A;
   default:
     if(Curl_ipv6works(data))
-      return (CURL_DNSQ_A|CURL_DNSQ_AAAA);
+      return (CURL_DNSQ_A | CURL_DNSQ_AAAA);
     else
       return CURL_DNSQ_A;
   }
@@ -139,15 +131,15 @@ uint8_t Curl_resolv_dns_queries(struct Curl_easy *data, uint8_t ip_version)
 const char *Curl_resolv_query_str(uint8_t dns_queries)
 {
   switch(dns_queries) {
-  case (CURL_DNSQ_A|CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
+  case (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
     return "A+AAAA+HTTPS";
-  case (CURL_DNSQ_A|CURL_DNSQ_AAAA):
+  case (CURL_DNSQ_A | CURL_DNSQ_AAAA):
     return "A+AAAA";
-  case (CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS):
+  case (CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS):
     return "AAAA+HTTPS";
   case (CURL_DNSQ_AAAA):
     return "AAAA";
-  case (CURL_DNSQ_A|CURL_DNSQ_HTTPS):
+  case (CURL_DNSQ_A | CURL_DNSQ_HTTPS):
     return "A+HTTPS";
   case (CURL_DNSQ_A):
     return "A";
@@ -162,6 +154,13 @@ const char *Curl_resolv_query_str(uint8_t dns_queries)
 }
 #endif
 
+/*
+ * Curl_printable_address() stores a printable version of the 1st address
+ * given in the 'ai' argument. The result will be stored in the buf that is
+ * bufsize bytes big.
+ *
+ * If the conversion fails, the target buffer is empty.
+ */
 void Curl_printable_address(const struct Curl_addrinfo *ai, char *buf,
                             size_t bufsize)
 {
@@ -360,13 +359,12 @@ CURLcode Curl_resolv_announce_start(struct Curl_easy *data,
 }
 
 #ifdef USE_CURL_ASYNC
-static struct Curl_resolv_async *
-hostip_async_new(struct Curl_easy *data,
-                 uint8_t dns_queries,
-                 const char *hostname,
-                 uint16_t port,
-                 uint8_t transport,
-                 timediff_t timeout_ms)
+static struct Curl_resolv_async *hostip_async_new(struct Curl_easy *data,
+                                                  uint8_t dns_queries,
+                                                  const char *hostname,
+                                                  uint16_t port,
+                                                  uint8_t transport,
+                                                  timediff_t timeout_ms)
 {
   struct Curl_resolv_async *async;
   size_t hostlen = strlen(hostname);
@@ -442,9 +440,10 @@ static CURLcode hostip_resolv_take_result(struct Curl_easy *data,
   return result;
 }
 
-const struct Curl_addrinfo *
-Curl_resolv_get_ai(struct Curl_easy *data, uint32_t resolv_id,
-                   int ai_family, unsigned int index)
+const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
+                                               uint32_t resolv_id,
+                                               int ai_family,
+                                               unsigned int index)
 {
 #ifdef CURLRES_ASYNCH
   struct Curl_resolv_async *async = Curl_async_get(data, resolv_id);
@@ -959,7 +958,6 @@ CURLcode Curl_resolv(struct Curl_easy *data,
                        timeout_ms, TRUE, presolv_id, entry);
 }
 
-
 #ifdef USE_CURL_ASYNC
 
 struct Curl_resolv_async *Curl_async_get(struct Curl_easy *data,
index a948fba9e7b1a39b86c5e480938cbbd4d4eea3f1..fc91a0ca412cec90380cd3df56ca330d8a8fab3d 100644 (file)
@@ -51,8 +51,8 @@ struct Curl_dns_entry;
 #define CURL_DNSQ_AAAA        (1U << 1)
 #define CURL_DNSQ_HTTPS       (1U << 2)
 
-#define CURL_DNSQ_ALL         (CURL_DNSQ_A|CURL_DNSQ_AAAA|CURL_DNSQ_HTTPS)
-#define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A|CURL_DNSQ_AAAA))
+#define CURL_DNSQ_ALL         (CURL_DNSQ_A | CURL_DNSQ_AAAA | CURL_DNSQ_HTTPS)
+#define CURL_DNSQ_IP(x)       (uint8_t)((x)&(CURL_DNSQ_A | CURL_DNSQ_AAAA))
 
 #ifdef CURLVERBOSE
 const char *Curl_resolv_query_str(uint8_t dns_queries);
@@ -88,10 +88,10 @@ struct Curl_addrinfo *Curl_ipv4_resolve_r(const char *hostname, uint16_t port);
 
 /*
  * Curl_printable_address() returns a printable version of the 1st address
- * given in the 'ip' argument. The result will be stored in the buf that is
+ * given in the 'ai' argument. The result will be stored in the buf that is
  * bufsize bytes big.
  */
-void Curl_printable_address(const struct Curl_addrinfo *ip,
+void Curl_printable_address(const struct Curl_addrinfo *ai,
                             char *buf, size_t bufsize);
 
 /* Start DNS resolving for the given parameters. Returns
@@ -142,25 +142,26 @@ CURLcode Curl_resolv_take_result(struct Curl_easy *data, uint32_t resolv_id,
 
 void Curl_resolv_destroy(struct Curl_easy *data, uint32_t resolv_id);
 
-const struct Curl_addrinfo *
-Curl_resolv_get_ai(struct Curl_easy *data, uint32_t resolv_id,
-                   int ai_family, unsigned int index);
+const struct Curl_addrinfo *Curl_resolv_get_ai(struct Curl_easy *data,
+                                               uint32_t resolv_id,
+                                               int ai_family,
+                                               unsigned int index);
 #ifdef USE_HTTPSRR
-const struct Curl_https_rrinfo *
-Curl_resolv_get_https(struct Curl_easy *data, uint32_t resolv_id);
+const struct Curl_https_rrinfo *Curl_resolv_get_https(struct Curl_easy *data,
+                                                      uint32_t resolv_id);
 bool Curl_resolv_knows_https(struct Curl_easy *data, uint32_t resolv_id);
 #endif /* USE_HTTPSRR */
 
-#else /* USE_CURL_ASYNC */
-#define Curl_resolv_shutdown_all(x)   Curl_nop_stmt
-#define Curl_resolv_destroy_all(x)    Curl_nop_stmt
+#else /* !USE_CURL_ASYNC */
+#define Curl_resolv_shutdown_all(x)      Curl_nop_stmt
+#define Curl_resolv_destroy_all(x)       Curl_nop_stmt
 #define Curl_resolv_take_result(x, y, z) CURLE_NOT_BUILT_IN
-#define Curl_resolv_get_ai(x,y,z, a)  NULL
-#define Curl_resolv_get_https(x,y)    NULL
-#define Curl_resolv_knows_https(x,y)  TRUE
-#define Curl_resolv_pollset(x,y)      CURLE_OK
-#define Curl_resolv_destroy(x,y)      Curl_nop_stmt
-#endif /* USE_CURL_ASYNC, else */
+#define Curl_resolv_get_ai(x, y, z, a)   NULL
+#define Curl_resolv_get_https(x, y)      NULL
+#define Curl_resolv_knows_https(x, y)    TRUE
+#define Curl_resolv_pollset(x, y)        CURLE_OK
+#define Curl_resolv_destroy(x, y)        Curl_nop_stmt
+#endif /* USE_CURL_ASYNC */
 
 CURLcode Curl_resolver_error(struct Curl_easy *data, const char *detail);
 
index 2eb66ca42a9efe6071e4094597bb906865971b4d..fb35e3992ca4410c25b4463dc1f70dc43f6c1205 100644 (file)
@@ -88,7 +88,7 @@ struct Curl_addrinfo *Curl_sync_getaddrinfo(struct Curl_easy *data,
 #endif /* CURLRES_IPV4 */
 
 #if defined(CURLRES_IPV4) && !defined(USE_RESOLV_ARES) && \
-    !defined(CURLRES_AMIGA)
+  !defined(CURLRES_AMIGA)
 
 /*
  * Curl_ipv4_resolve_r() - ipv4 thread-safe resolver function.
index 34cd25722d2be4243a43b2679eb4dbe007643861..d82459e738d879b3a38d47ff0ed1a49d2b83d748 100644 (file)
@@ -472,53 +472,53 @@ static bool http_should_fail(struct Curl_easy *data, int httpcode)
   DEBUGASSERT(data->conn);
 
   /*
-  ** If we have not been asked to fail on error,
-  ** do not fail.
-  */
+   * If we have not been asked to fail on error,
+   * do not fail.
+   */
   if(!data->set.http_fail_on_error)
     return FALSE;
 
   /*
-  ** Any code < 400 is never terminal.
-  */
+   * Any code < 400 is never terminal.
+   */
   if(httpcode < 400)
     return FALSE;
 
   /*
-  ** A 416 response to a resume request is presumably because the file is
-  ** already completely downloaded and thus not actually a fail.
-  */
+   * A 416 response to a resume request is presumably because the file is
+   * already completely downloaded and thus not actually a fail.
+   */
   if(data->state.resume_from && data->state.httpreq == HTTPREQ_GET &&
      httpcode == 416)
     return FALSE;
 
   /*
-  ** Any code >= 400 that is not 401 or 407 is always
-  ** a terminal error
-  */
+   * Any code >= 400 that is not 401 or 407 is always
+   * a terminal error
+   */
   if((httpcode != 401) && (httpcode != 407))
     return TRUE;
 
   /*
-  ** All we have left to deal with is 401 and 407
-  */
+   * All we have left to deal with is 401 and 407
+   */
   DEBUGASSERT((httpcode == 401) || (httpcode == 407));
 
   /*
-  ** Examine the current authentication state to see if this is an error. The
-  ** idea is for this function to get called after processing all the headers
-  ** in a response message. If we have been to asked to authenticate
-  ** a particular stage, and we have done it, we are OK. If we are already
-  ** completely authenticated, it is not OK to get another 401 or 407.
-  **
-  ** It is possible for authentication to go stale such that the client needs
-  ** to reauthenticate. Once that info is available, use it here.
-  */
+   * Examine the current authentication state to see if this is an error. The
+   * idea is for this function to get called after processing all the headers
+   * in a response message. If we have been to asked to authenticate
+   * a particular stage, and we have done it, we are OK. If we are already
+   * completely authenticated, it is not OK to get another 401 or 407.
+   *
+   * It is possible for authentication to go stale such that the client needs
+   * to reauthenticate. Once that info is available, use it here.
+   */
 
   /*
-  ** Either we are not authenticating, or we are supposed to be authenticating
-  ** something else. This is an error.
-  */
+   * Either we are not authenticating, or we are supposed to be authenticating
+   * something else. This is an error.
+   */
   if((httpcode == 401) && !data->state.aptr.user)
     return TRUE;
 #ifndef CURL_DISABLE_PROXY
@@ -766,14 +766,14 @@ static CURLcode output_auth_headers(struct Curl_easy *data,
  *
  * @returns CURLcode
  */
-CURLcode
-Curl_http_output_auth(struct Curl_easy *data,
-                      struct connectdata *conn,
-                      const char *request,
-                      Curl_HttpReq httpreq,
-                      const char *path,
-                      bool proxytunnel) /* TRUE if this is the request setting
-                                           up the proxy tunnel */
+CURLcode Curl_http_output_auth(struct Curl_easy *data,
+                               struct connectdata *conn,
+                               const char *request,
+                               Curl_HttpReq httpreq,
+                               const char *path,
+                               bool proxytunnel) /* TRUE if this is
+                                                    the request setting up
+                                                    the proxy tunnel */
 {
   CURLcode result = CURLE_OK;
   struct auth *authhost;
@@ -1506,7 +1506,7 @@ static CURLcode cr_exp100_read(struct Curl_easy *data,
     /* We are now waiting for a reply from the server or
      * a timeout on our side IFF the request has been fully sent. */
     DEBUGF(infof(data, "cr_exp100_read, start AWAITING_CONTINUE, "
-           "timeout %dms", data->set.expect_100_timeout));
+                 "timeout %dms", data->set.expect_100_timeout));
     ctx->state = EXP100_AWAITING_CONTINUE;
     ctx->start = *Curl_pgrs_now(data);
     Curl_expire(data, data->set.expect_100_timeout, EXPIRE_100_TIMEOUT);
@@ -4024,7 +4024,7 @@ static void http_check_auth_closure(struct Curl_easy *data,
 #endif
 }
 #else
-#define http_check_auth_closure(x,y) /* empty */
+#define http_check_auth_closure(x, y) /* empty */
 #endif
 
 /*
@@ -4603,7 +4603,7 @@ CURLcode Curl_http_write_resp_hd(struct Curl_easy *data,
 
   result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
   if(!result && is_eos) {
-    result = Curl_client_write(data, (CLIENTWRITE_BODY|CLIENTWRITE_EOS),
+    result = Curl_client_write(data, (CLIENTWRITE_BODY | CLIENTWRITE_EOS),
                                &tmp, 0);
   }
   return result;
index 85d1c6c56050014237bd7e99594acc67cc43fab9..6e33c00e921926f0845e6bdaf38b031e85c4099a 100644 (file)
@@ -185,14 +185,14 @@ CURLcode Curl_http_write_resp_hds(struct Curl_easy *data,
  *
  * @returns CURLcode
  */
-CURLcode
-Curl_http_output_auth(struct Curl_easy *data,
-                      struct connectdata *conn,
-                      const char *request,
-                      Curl_HttpReq httpreq,
-                      const char *path,
-                      bool proxytunnel); /* TRUE if this is the request setting
-                                            up the proxy tunnel */
+CURLcode Curl_http_output_auth(struct Curl_easy *data,
+                               struct connectdata *conn,
+                               const char *request,
+                               Curl_HttpReq httpreq,
+                               const char *path,
+                               bool proxytunnel); /* TRUE if this is
+                                                     the request setting up
+                                                     the proxy tunnel */
 
 /* Decode HTTP status code string. */
 CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len);
index d5f3132252e812f2a16c2958858b0cbe041dc962..54044bcb9dabe3e403f6163a1c8e6237422048ab 100644 (file)
@@ -1734,8 +1734,8 @@ static CURLcode http2_handle_stream_close(struct Curl_cfilter *cf,
         break;
       curlx_dyn_reset(&dbuf);
       result = curlx_dyn_addf(&dbuf, "%.*s: %.*s\x0d\x0a",
-                            (int)e->namelen, e->name,
-                            (int)e->valuelen, e->value);
+                              (int)e->namelen, e->name,
+                              (int)e->valuelen, e->value);
       if(result)
         break;
       Curl_debug(data, CURLINFO_HEADER_IN, curlx_dyn_ptr(&dbuf),
index 6414ca915aa68600ca8f3abc52e95822ebd735d7..a3d8cfeb2a10f9fb5177cf12d6f2fddb334017b9 100644 (file)
@@ -680,7 +680,8 @@ static int compare_func(const void *a, const void *b)
 }
 
 UNITTEST CURLcode canon_path(const char *q, size_t len,
-                             struct dynbuf *new_path, bool normalize);
+                             struct dynbuf *new_path,
+                             bool do_uri_encode);
 UNITTEST CURLcode canon_path(const char *q, size_t len,
                              struct dynbuf *new_path,
                              bool do_uri_encode)
index db650b1e1e645b6e0a68dd08e362af7ed5c95b62..aa45c79e3853f2227e6c639def6a6f146556458c 100644 (file)
@@ -258,12 +258,12 @@ static CURLcode httpchunk_readwrite(struct Curl_easy *data,
             size_t trlen = curlx_dyn_len(&ch->trailer);
             if(cw_next)
               result = Curl_cwriter_write(data, cw_next,
-                                          CLIENTWRITE_HEADER|
+                                          CLIENTWRITE_HEADER |
                                           CLIENTWRITE_TRAILER,
                                           tr, trlen);
             else
               result = Curl_client_write(data,
-                                         CLIENTWRITE_HEADER|
+                                         CLIENTWRITE_HEADER |
                                          CLIENTWRITE_TRAILER,
                                          tr, trlen);
             if(result) {
index c737d2ffd3734be95b61e1e770fe476847e832e3..8d02d245421860614359d41217f8d4c27e3fda1a 100644 (file)
@@ -135,7 +135,7 @@ void Curl_httpsrr_trace(struct Curl_easy *data,
 }
 
 #else
-#define httpsrr_report_addr(a,b,c,d)    Curl_nop_stmt
+#define httpsrr_report_addr(a, b, c, d) Curl_nop_stmt
 #endif /* CURLVERBOSE */
 
 CURLcode Curl_httpsrr_set(struct Curl_https_rrinfo *hi,
@@ -194,8 +194,8 @@ CURLcode Curl_httpsrr_set(struct Curl_https_rrinfo *hi,
   return result;
 }
 
-struct Curl_https_rrinfo *
-Curl_httpsrr_dup_move(struct Curl_https_rrinfo *rrinfo)
+struct Curl_https_rrinfo *Curl_httpsrr_dup_move(
+  struct Curl_https_rrinfo *rrinfo)
 {
   struct Curl_https_rrinfo *dup = curlx_memdup(rrinfo, sizeof(*rrinfo));
   if(dup)
index eba69489c52e22f6fdf5cd3c76169e9e564b5297..68f5dad875f62bd6b333cc84f5e135a2f3e0bb55 100644 (file)
@@ -62,8 +62,8 @@ struct Curl_https_rrinfo {
 CURLcode Curl_httpsrr_set(struct Curl_https_rrinfo *hi,
                           uint16_t rrkey, const uint8_t *val, size_t vlen);
 
-struct Curl_https_rrinfo *
-Curl_httpsrr_dup_move(struct Curl_https_rrinfo *rrinfo);
+struct Curl_https_rrinfo *Curl_httpsrr_dup_move(
+  struct Curl_https_rrinfo *rrinfo);
 
 void Curl_httpsrr_cleanup(struct Curl_https_rrinfo *rrinfo);
 
@@ -87,7 +87,7 @@ CURLcode Curl_httpsrr_from_ares(const ares_dns_record_t *dnsrec,
 void Curl_httpsrr_trace(struct Curl_easy *data,
                         struct Curl_https_rrinfo *hi);
 #else
-#define Curl_httpsrr_trace(a,b)     Curl_nop_stmt
+#define Curl_httpsrr_trace(a, b) Curl_nop_stmt
 #endif
 
 #endif /* USE_HTTPSRR */
index 2905e39162088255f3a154667de6de0c01702a7f..f2b954e2d03edfb3392dfac06a24164cf66bdffa 100644 (file)
--- a/lib/idn.c
+++ b/lib/idn.c
 #include <idn2.h>
 
 #if defined(_WIN32) && defined(UNICODE)
-#define IDN2_LOOKUP(name, host, flags)                                  \
+#define IDN2_LOOKUP(name, host, flags)                           \
   idn2_lookup_u8((const uint8_t *)name, (uint8_t **)host, flags)
 #else
-#define IDN2_LOOKUP(name, host, flags)                          \
+#define IDN2_LOOKUP(name, host, flags)                         \
   idn2_lookup_ul((const char *)(name), (char **)(host), flags)
 #endif
 #endif /* USE_LIBIDN2 */
index d02675f1c0c452a3d34fbfc6c0c08dc230648a0b..0213483ad30cb3787e615249544dde33659d0910 100644 (file)
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -33,7 +33,7 @@
 /* OpenSSL 3.0.0 marks the MD4 functions as deprecated */
 #define OPENSSL_NO_MD4
 #else
-/* Cover also OPENSSL_NO_MD4 configured in openssl */
+/* Cover also OPENSSL_NO_MD4 configured in OpenSSL */
 #include <openssl/opensslconf.h>
 #endif
 #endif /* USE_OPENSSL */
index b4b77e41627757e496e19bdd4a1f13254d5f17ee..4dd0d7c27859759127538d2b121cedf61e02c16d 100644 (file)
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -548,7 +548,7 @@ CURLcode Curl_md5it(unsigned char *output,
   result = my_md5_init(&ctx);
   if(!result) {
     do {
-      unsigned int ilen = (unsigned int) CURLMIN(len, UINT_MAX);
+      unsigned int ilen = (unsigned int)CURLMIN(len, UINT_MAX);
       my_md5_update(&ctx, input, ilen);
       input += ilen;
       len -= ilen;
index 93210d2613ef1f88b3f554a09d5746506da73223..157884a83836343a68c80e7ad1386166eac7548f 100644 (file)
@@ -1937,7 +1937,7 @@ static CURLcode cr_mime_read(struct Curl_easy *data,
   case 0:
     if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
       failf(data, "client mime read EOF fail, "
-            "only %"FMT_OFF_T"/%"FMT_OFF_T
+            "only %" FMT_OFF_T "/%" FMT_OFF_T
             " of needed bytes read", ctx->read_len, ctx->total_len);
       return CURLE_READ_ERROR;
     }
@@ -1992,7 +1992,7 @@ static CURLcode cr_mime_read(struct Curl_easy *data,
   }
 
   CURL_TRC_READ(data, "cr_mime_read(len=%zu, total=%" FMT_OFF_T
-                ", read=%"FMT_OFF_T") -> %d, %zu, %d",
+                ", read=%" FMT_OFF_T ") -> %d, %zu, %d",
                 blen, ctx->total_len, ctx->read_len, result, *pnread, *peos);
   return result;
 }
index 8a6a26c0e9fa30f82002398c3a89a8f1b96c2f26..f2348aae0e9cba40d92b9ab1b78f6c5c272b7757 100644 (file)
@@ -39,11 +39,11 @@ const unsigned char Curl_ldigits[] = "0123456789abcdef";
 /* Upper-case digits. */
 const unsigned char Curl_udigits[] = "0123456789ABCDEF";
 
-#define OUTCHAR(x)                                       \
-  do {                                                   \
-    if(stream((unsigned char)(x), userp))                \
-      return TRUE;                                       \
-    (*donep)++;                                          \
+#define OUTCHAR(x)                        \
+  do {                                    \
+    if(stream((unsigned char)(x), userp)) \
+      return TRUE;                        \
+    (*donep)++;                           \
   } while(0)
 
 /* Data type to read from the arglist */
index 9a45548c75131ab3e575c0c509014ae1dc61106c..10be2b56abfd4b9fe987608598c7c35ae1e8bcb7 100644 (file)
@@ -74,7 +74,6 @@
 
 #define CURL_MULTI_HANDLE 0x000bab1e
 
-
 #ifdef DEBUGBUILD
 /* On a debug build, we want to fail hard on multi handles that
  * are not NULL, but no longer have the MAGIC touch. This gives
index 230000939d857a7d73f77df4f3d9de4233774f1e..eecec2757b08bd9b2016ae3fd4382f440590e8a3 100644 (file)
@@ -361,7 +361,6 @@ void Curl_pgrs_deliver_inc(struct Curl_easy *data, size_t delta)
   data->progress.deliver += delta;
 }
 
-
 void Curl_pgrs_download_inc(struct Curl_easy *data, size_t delta)
 {
   if(delta) {
index 2a9f08388f32541c418412604d47cf4b8d338f94..c8d43251cf7ebb76efed3b9c1ee941265743aa59 100644 (file)
@@ -322,8 +322,7 @@ const struct Curl_scheme Curl_scheme_smb = {
 
 const struct Curl_scheme Curl_scheme_smbs = {
   "smbs",                               /* scheme */
-#if defined(CURL_ENABLE_SMB) && defined(USE_CURL_NTLM_CORE) &&  \
-  defined(USE_SSL)
+#if defined(CURL_ENABLE_SMB) && defined(USE_CURL_NTLM_CORE) && defined(USE_SSL)
   &Curl_protocol_smb,
 #else
   ZERO_NULL,
@@ -405,7 +404,7 @@ const struct Curl_scheme Curl_scheme_ws = {
 const struct Curl_scheme Curl_scheme_wss = {
   "wss",                                /* scheme */
 #if defined(CURL_DISABLE_WEBSOCKETS) || defined(CURL_DISABLE_HTTP) || \
-    !defined(USE_SSL)
+  !defined(USE_SSL)
   ZERO_NULL,
 #else
   &Curl_protocol_ws,
index e35f99d2d860baa1c69cc73087036210826e47cd..391493a1122c8146e26d1ce7d643ac02ac3d1591 100644 (file)
@@ -38,16 +38,17 @@ struct UserDefined;
 /* Low level request receive/send io_flags checks. */
 #define CURL_REQ_WANT_SEND(d)  ((d)->req.io_flags & REQ_IO_SEND)
 #define CURL_REQ_WANT_RECV(d)  ((d)->req.io_flags & REQ_IO_RECV)
-#define CURL_REQ_WANT_IO(d)    ((d)->req.io_flags & (REQ_IO_RECV|REQ_IO_SEND))
+#define CURL_REQ_WANT_IO(d)    \
+  ((d)->req.io_flags & (REQ_IO_RECV | REQ_IO_SEND))
 /* Low level request receive/send io_flags manipulations. */
-#define CURL_REQ_SET_SEND(d)  ((d)->req.io_flags |= REQ_IO_SEND)
-#define CURL_REQ_SET_RECV(d)  ((d)->req.io_flags |= REQ_IO_RECV)
+#define CURL_REQ_SET_SEND(d)   ((d)->req.io_flags |= REQ_IO_SEND)
+#define CURL_REQ_SET_RECV(d)   ((d)->req.io_flags |= REQ_IO_RECV)
 #define CURL_REQ_CLEAR_SEND(d) \
   ((d)->req.io_flags &= (uint8_t)~REQ_IO_SEND)
 #define CURL_REQ_CLEAR_RECV(d) \
   ((d)->req.io_flags &= (uint8_t)~REQ_IO_RECV)
 #define CURL_REQ_CLEAR_IO(d)  \
-  ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV|REQ_IO_SEND))
+  ((d)->req.io_flags &= (uint8_t)~(REQ_IO_RECV | REQ_IO_SEND))
 
 enum expect100 {
   EXP100_SEND_DATA,           /* enough waiting, send the body now */
index c3c050fc691782e342b39354bd35004a82b9af46..285126371c55b3abda3746a1b441d379630d10dc 100644 (file)
@@ -234,7 +234,7 @@ static CURLcode rtsp_setup_body(struct Curl_easy *data,
       /* As stated in the http comments, it is probably not wise to
        * actually set a custom Content-Length in the headers */
       if(!Curl_checkheaders(data, STRCONST("Content-Length"))) {
-        result = curlx_dyn_addf(reqp, "Content-Length: %" FMT_OFF_T"\r\n",
+        result = curlx_dyn_addf(reqp, "Content-Length: %" FMT_OFF_T "\r\n",
                                 req_clen);
         if(result)
           return result;
index 34461ccaa861ff76d158da7df645bd9bba775be6..888490f2c9acc1618239ff58e66aeec0b656a551 100644 (file)
@@ -274,7 +274,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms)
     if(ufds[i].fd == CURL_SOCKET_BAD)
       continue;
     VERIFY_SOCK(ufds[i].fd);
-    if(ufds[i].events & (POLLIN |POLLOUT |POLLPRI |
+    if(ufds[i].events & (POLLIN | POLLOUT | POLLPRI |
                          POLLRDNORM | POLLWRNORM | POLLRDBAND)) {
       if(ufds[i].fd > maxfd)
         maxfd = ufds[i].fd;
@@ -636,9 +636,9 @@ CURLcode Curl_pollset_set(struct Curl_easy *data,
                           bool do_in, bool do_out)
 {
   return Curl_pollset_change(data, ps, sock,
-                             (do_in ? CURL_POLL_IN : 0)|
+                             (do_in ? CURL_POLL_IN : 0) |
                              (do_out ? CURL_POLL_OUT : 0),
-                             (!do_in ? CURL_POLL_IN : 0)|
+                             (!do_in ? CURL_POLL_IN : 0) |
                              (!do_out ? CURL_POLL_OUT : 0));
 }
 
index ffcd44cfcfc773158bcc47a6d422ddfb962b39c1..87b695463fcb6d359e3db826d2009f018125c010 100644 (file)
@@ -35,9 +35,7 @@
  * Definition of pollfd struct and constants for platforms lacking them.
  */
 
-#if !defined(HAVE_SYS_POLL_H) && \
-    !defined(HAVE_POLL_H) && \
-    !defined(POLLIN)
+#if !defined(HAVE_SYS_POLL_H) && !defined(HAVE_POLL_H) && !defined(POLLIN)
 
 #define POLLIN      0x01
 #define POLLPRI     0x02
index 74e7038a7fa674462ae8078b8f223c436ca76bf4..7c977d3b9ea5b94d7ef5d935e35080328718c8e2 100644 (file)
@@ -372,8 +372,8 @@ static CURLcode do_init_writer_stack(struct Curl_easy *data)
    The bit pattern defines to what "streams" to write to. Body and/or header.
    The defines are in sendf.h of course.
  */
-CURLcode Curl_client_write(struct Curl_easy *data,
-                           int type, const char *buf, size_t len)
+CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf,
+                           size_t len)
 {
   CURLcode result;
 
@@ -675,7 +675,7 @@ static CURLcode cr_in_read(struct Curl_easy *data,
   case 0:
     if((ctx->total_len >= 0) && (ctx->read_len < ctx->total_len)) {
       failf(data, "client read function EOF fail, "
-            "only %"FMT_OFF_T"/%"FMT_OFF_T " of needed bytes read",
+            "only %" FMT_OFF_T "/%" FMT_OFF_T " of needed bytes read",
             ctx->read_len, ctx->total_len);
       result = CURLE_READ_ERROR;
       break;
@@ -729,8 +729,8 @@ static CURLcode cr_in_read(struct Curl_easy *data,
     *peos = (bool)ctx->seen_eos;
     break;
   }
-  CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%"FMT_OFF_T
-                ", read=%"FMT_OFF_T") -> %d, nread=%zu, eos=%d",
+  CURL_TRC_READ(data, "cr_in_read(len=%zu, total=%" FMT_OFF_T
+                ", read=%" FMT_OFF_T ") -> %d, nread=%zu, eos=%d",
                 blen, ctx->total_len, ctx->read_len, result,
                 *pnread, *peos);
   return result;
@@ -1138,7 +1138,7 @@ CURLcode Curl_creader_set_fread(struct Curl_easy *data, curl_off_t len)
   cl_reset_reader(data);
   result = do_init_reader_stack(data, r);
 out:
-  CURL_TRC_READ(data, "add fread reader, len=%"FMT_OFF_T " -> %d",
+  CURL_TRC_READ(data, "add fread reader, len=%" FMT_OFF_T " -> %d",
                 len, result);
   return result;
 }
index 084cd9f62b3e0e055db3858fed385dc8e16d9b69..b5bd73367257827218e17ee6404295f9e9d0cf84 100644 (file)
@@ -67,22 +67,22 @@ extern int Curl_getnameinfo_a(const struct sockaddr *sa,
 
 /* GSSAPI wrappers. */
 
-extern OM_uint32 Curl_gss_import_name_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_import_name_a(OM_uint32 *minor_status,
                                         gss_buffer_t in_name,
                                         gss_OID in_name_type,
-                                        gss_name_t * out_name);
+                                        gss_name_t *out_name);
 #define gss_import_name         Curl_gss_import_name_a
 
-extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_display_status_a(OM_uint32 *minor_status,
                                            OM_uint32 status_value,
                                            int status_type, gss_OID mech_type,
-                                           gss_msg_ctx_t * message_context,
+                                           gss_msg_ctx_t *message_context,
                                            gss_buffer_t status_string);
 #define gss_display_status      Curl_gss_display_status_a
 
-extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
+extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 *minor_status,
                                              gss_cred_id_t cred_handle,
-                                             gss_ctx_id_t * context_handle,
+                                             gss_ctx_id_t *context_handle,
                                              gss_name_t target_name,
                                              gss_OID mech_type,
                                              gss_flags_t req_flags,
@@ -90,10 +90,10 @@ extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
                                              gss_channel_bindings_t
                                              input_chan_bindings,
                                              gss_buffer_t input_token,
-                                             gss_OID * actual_mech_type,
+                                             gss_OID *actual_mech_type,
                                              gss_buffer_t output_token,
-                                             gss_flags_t * ret_flags,
-                                             OM_uint32 * time_rec);
+                                             gss_flags_t *ret_flags,
+                                             OM_uint32 *time_rec);
 #define gss_init_sec_context    Curl_gss_init_sec_context_a
 
 extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
index ba747ec0424301b0b8204411ca92ccc67ed86d99..d97f45f05f9b443a3583be3704a5303ee1f42119 100644 (file)
@@ -255,7 +255,7 @@ static void my_sha256_final(unsigned char *digest, void *in)
     (a)[0] = (unsigned char)((((unsigned long)(val)) >> 24) & 0xff); \
     (a)[1] = (unsigned char)((((unsigned long)(val)) >> 16) & 0xff); \
     (a)[2] = (unsigned char)((((unsigned long)(val)) >>  8) & 0xff); \
-    (a)[3] = (unsigned char) (((unsigned long)(val)) & 0xff);        \
+    (a)[3] = (unsigned char)(((unsigned long)(val)) & 0xff);         \
   } while(0)
 
 #define WPA_PUT_BE64(a, val)                            \
@@ -486,7 +486,7 @@ CURLcode Curl_sha256it(unsigned char *output, const unsigned char *input,
   result = my_sha256_init(&ctx);
   if(!result) {
     do {
-      unsigned int ilen = (unsigned int) CURLMIN(len, UINT_MAX);
+      unsigned int ilen = (unsigned int)CURLMIN(len, UINT_MAX);
       my_sha256_update(&ctx, input, ilen);
       len -= ilen;
       input += ilen;
index 2aa173396bdaebab6231077c8d4717f2c80fcb11..0427e72fc53d2270fccceec1ecdac46e30a9e361 100644 (file)
@@ -37,7 +37,7 @@ int Curl_wakeup_signal(curl_socket_t socks[2]);
 CURLcode Curl_wakeup_consume(curl_socket_t socks[2], bool all);
 
 #else
-#define Curl_wakeup_destroy(x)  Curl_nop_stmt
+#define Curl_wakeup_destroy(x) Curl_nop_stmt
 #endif
 
 #endif /* HEADER_CURL_SOCKETPAIR_H */
index 71584875559d1b72f981dd64893c408d9b0fec28..32db07044a92dbfe157934d122dd855ad6f2644d 100644 (file)
@@ -228,7 +228,7 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
     if(gss_major_status != GSS_S_CONTINUE_NEEDED)
       break;
 
-    /* analyse response */
+    /* analyze response */
 
     /*   GSS-API response looks like
      * +----+------+-----+----------------+
index df82870900698ba99afbf7ae392a9baed9f4bd82..c5ce9c2c97e3799990b0cd3b1d979b8e2aa24b34 100644 (file)
@@ -1266,9 +1266,9 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done)
 
 #ifdef USE_WINSOCK
   /* We want to wait for both stdin and the socket. Since
-  ** the select() function in Winsock only works on sockets
-  ** we have to use the WaitForMultipleObjects() call.
-  */
+   * the select() function in Winsock only works on sockets
+   * we have to use the WaitForMultipleObjects() call.
+   */
 
   /* First, create a sockets event object */
   event_handle = WSACreateEvent();
index 58dcbdac227519fa6787f3d3eedc00cbab1aba56..d05b530258ad25e5aa3c07a40cf37cfc5f828115 100644 (file)
@@ -30,9 +30,6 @@
 #define CURL_UINT32_SPBSET_MAGIC  0x70737362
 #endif
 
-/* Clear the bitset, making it empty. */
-UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset);
-
 void Curl_uint32_spbset_init(struct uint32_spbset *bset)
 {
   memset(bset, 0, sizeof(*bset));
@@ -41,6 +38,19 @@ void Curl_uint32_spbset_init(struct uint32_spbset *bset)
 #endif
 }
 
+/* Clear the bitset, making it empty. */
+UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset);
+UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset)
+{
+  struct uint32_spbset_chunk *next, *chunk;
+
+  for(chunk = bset->head.next; chunk; chunk = next) {
+    next = chunk->next;
+    curlx_free(chunk);
+  }
+  memset(&bset->head, 0, sizeof(bset->head));
+}
+
 void Curl_uint32_spbset_destroy(struct uint32_spbset *bset)
 {
   DEBUGASSERT(bset->init == CURL_UINT32_SPBSET_MAGIC);
@@ -61,19 +71,8 @@ uint32_t Curl_uint32_spbset_count(struct uint32_spbset *bset)
   return n;
 }
 
-UNITTEST void Curl_uint32_spbset_clear(struct uint32_spbset *bset)
-{
-  struct uint32_spbset_chunk *next, *chunk;
-
-  for(chunk = bset->head.next; chunk; chunk = next) {
-    next = chunk->next;
-    curlx_free(chunk);
-  }
-  memset(&bset->head, 0, sizeof(bset->head));
-}
-
-static struct uint32_spbset_chunk *
-uint32_spbset_get_chunk(struct uint32_spbset *bset, uint32_t i, bool grow)
+static struct uint32_spbset_chunk *uint32_spbset_get_chunk(
+  struct uint32_spbset *bset, uint32_t i, bool grow)
 {
   struct uint32_spbset_chunk *chunk, **panchor = NULL;
   uint32_t i_offset = (i & ~CURL_UINT32_SPBSET_CH_MASK);
index b9c1990130bc15461ce3938209d0f887c9255e05..e3162583dc7043654dd2e0fdd64785fc84821c11 100644 (file)
@@ -29,9 +29,6 @@
 #define CURL_UINT32_TBL_MAGIC  0x62757473
 #endif
 
-/* Clear the table, making it empty. */
-UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl);
-
 void Curl_uint32_tbl_init(struct uint32_tbl *tbl,
                           Curl_uint32_tbl_entry_dtor *entry_dtor)
 {
@@ -82,14 +79,8 @@ CURLcode Curl_uint32_tbl_resize(struct uint32_tbl *tbl, uint32_t nrows)
   return CURLE_OK;
 }
 
-void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl)
-{
-  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
-  Curl_uint32_tbl_clear(tbl);
-  curlx_free(tbl->rows);
-  memset(tbl, 0, sizeof(*tbl));
-}
-
+/* Clear the table, making it empty. */
+UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl);
 UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl)
 {
   DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
@@ -98,6 +89,14 @@ UNITTEST void Curl_uint32_tbl_clear(struct uint32_tbl *tbl)
   tbl->last_key_added = UINT32_MAX;
 }
 
+void Curl_uint32_tbl_destroy(struct uint32_tbl *tbl)
+{
+  DEBUGASSERT(tbl->init == CURL_UINT32_TBL_MAGIC);
+  Curl_uint32_tbl_clear(tbl);
+  curlx_free(tbl->rows);
+  memset(tbl, 0, sizeof(*tbl));
+}
+
 uint32_t Curl_uint32_tbl_capacity(struct uint32_tbl *tbl)
 {
   return tbl->nrows;
index 6be3a61ef962d31abf89efa59cbeaf36f463193e..237d674cc9ce6c3b611cdf5bc1a39af5866b5894 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -386,7 +386,7 @@ void Curl_init_userdefined(struct Curl_easy *data)
 #endif
 
   set->new_file_perms = 0644;    /* Default permissions */
-  set->allowed_protocols = (curl_prot_t) CURLPROTO_64ALL;
+  set->allowed_protocols = (curl_prot_t)CURLPROTO_64ALL;
   set->redir_protocols = CURLPROTO_REDIR;
 
 #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
index 3f3c4bef3cb57883cb2bc1184dca0fc375389aa2..837dbcd2fa49000ef9290f18208a51decd3de3d5 100644 (file)
--- a/lib/url.h
+++ b/lib/url.h
@@ -85,7 +85,7 @@ CURLcode Curl_conn_upkeep(struct Curl_easy *data,
 
 /**
  * Always eval all arguments, return the first
- * result != (CURLE_OK|CURLE_AGAIN) or `r1`.
+ * result != (CURLE_OK | CURLE_AGAIN) or `r1`.
  */
 CURLcode Curl_1st_fatal(CURLcode r1, CURLcode r2);
 
index dc4323f93976d810f7ce4a2bf6530b477491d3ac..1d29e545debb547a1beaa7de0c084bca4bc9369c 100644 (file)
@@ -32,7 +32,7 @@ CURLUcode Curl_url_set_authority(CURLU *u, const char *authority);
 
 CURLUcode Curl_junkscan(const char *url, size_t *urllen, bool allowspace);
 
-#define U_CURLU_URLDECODE (unsigned int)CURLU_URLDECODE
+#define U_CURLU_URLDECODE  (unsigned int)CURLU_URLDECODE
 #define U_CURLU_PATH_AS_IS (unsigned int)CURLU_PATH_AS_IS
 
 #endif /* HEADER_CURL_URLAPI_INT_H */
index 5928d1e440e97407f6967b55417ee910e055424a..97f29b000c7ee1743ace43b8cda1f1411bfe899a 100644 (file)
@@ -26,7 +26,7 @@
 /* This file is for lib internal stuff */
 #include "curl_setup.h"
 
-#define CURL_DEFAULT_USER "anonymous"
+#define CURL_DEFAULT_USER     "anonymous"
 #define CURL_DEFAULT_PASSWORD "ftp@example.com"
 
 #if !defined(_WIN32) && !defined(MSDOS)
index e5a6f8d80b680e04dd7525271f9cf70dc575bcde..b3b0a46abbb1d2039392188848597e1ccf9015e2 100644 (file)
@@ -243,11 +243,9 @@ char *curl_version(void)
 #endif
 #ifdef HAVE_GSSAPI
 #ifdef HAVE_GSSGNU
-  curl_msnprintf(gss_buf, sizeof(gss_buf), "libgss/%s",
-                 GSS_VERSION);
+  curl_msnprintf(gss_buf, sizeof(gss_buf), "libgss/%s", GSS_VERSION);
 #elif defined(CURL_KRB5_VERSION)
-  curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5/%s",
-                 CURL_KRB5_VERSION);
+  curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5/%s", CURL_KRB5_VERSION);
 #else
   curl_msnprintf(gss_buf, sizeof(gss_buf), "mit-krb5");
 #endif
@@ -432,7 +430,7 @@ static const struct feat features_table[] = {
   FEATURE("alt-svc",     NULL,                CURL_VERSION_ALTSVC),
 #endif
 #if defined(USE_ARES) && defined(USE_RESOLV_THREADED) && defined(USE_HTTPSRR)
-  FEATURE("asyn-rr", NULL,             0),
+  FEATURE("asyn-rr",     NULL,                0),
 #endif
 #ifdef CURLRES_ASYNCH
   FEATURE("AsynchDNS",   NULL,                CURL_VERSION_ASYNCHDNS),
index 5572b3dd07e220db31b72b90995e1c4c51b0fb92..44094e466c8499921ca317f1bba4cf157ac258a7 100644 (file)
@@ -147,7 +147,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc)
     rc = ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_MD5, &hash, &hlen);
     if(rc != SSH_OK || hlen != 16) {
       failf(data,
-            "Denied establishing ssh session: md5 fingerprint not available");
+            "Denied establishing ssh session: MD5 fingerprint not available");
       goto cleanup;
     }
 
@@ -158,7 +158,7 @@ static int myssh_is_known(struct Curl_easy *data, struct ssh_conn *sshc)
 
     if(!curl_strequal(md5buffer, pubkey_md5)) {
       failf(data,
-            "Denied establishing ssh session: mismatch md5 fingerprint. "
+            "Denied establishing ssh session: mismatch MD5 fingerprint. "
             "Remote %s is not equal to %s", md5buffer, pubkey_md5);
       rc = SSH_ERROR;
       goto cleanup;
index 40858d18c0a16d760f28683b7db05376d58e1180..e4d35bbdcf12f5a0439a5167b3680957384b7871 100644 (file)
@@ -476,7 +476,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
                                        LIBSSH2_HOSTKEY_HASH_SHA256);
     if(!fingerprint) {
       failf(data,
-            "Denied establishing ssh session: sha256 fingerprint "
+            "Denied establishing ssh session: SHA256 fingerprint "
             "not available");
       myssh_to(data, sshc, SSH_SESSION_FREE);
       return CURLE_PEER_FAILED_VERIFICATION;
@@ -491,7 +491,7 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
     }
 
     if(!fingerprint_b64) {
-      failf(data, "sha256 fingerprint could not be encoded");
+      failf(data, "SHA256 fingerprint could not be encoded");
       myssh_to(data, sshc, SSH_SESSION_FREE);
       return CURLE_PEER_FAILED_VERIFICATION;
     }
@@ -509,13 +509,13 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
       b64_pos++;
     }
 
-    /* Before we authenticate we check the hostkey's sha256 fingerprint
+    /* Before we authenticate we check the hostkey's SHA256 fingerprint
      * against a known fingerprint, if available.
      */
     if((pub_pos != b64_pos) ||
        strncmp(fingerprint_b64, pubkey_sha256, pub_pos)) {
       failf(data,
-            "Denied establishing ssh session: mismatch sha256 fingerprint. "
+            "Denied establishing ssh session: mismatch SHA256 fingerprint. "
             "Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256);
       curlx_free(fingerprint_b64);
       myssh_to(data, sshc, SSH_SESSION_FREE);
@@ -550,12 +550,12 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data,
     if(!fingerprint || !curl_strequal(md5buffer, pubkey_md5)) {
       if(fingerprint) {
         failf(data,
-              "Denied establishing ssh session: mismatch md5 fingerprint. "
+              "Denied establishing ssh session: mismatch MD5 fingerprint. "
               "Remote %s is not equal to %s", md5buffer, pubkey_md5);
       }
       else {
         failf(data,
-              "Denied establishing ssh session: md5 fingerprint "
+              "Denied establishing ssh session: MD5 fingerprint "
               "not available");
       }
       myssh_to(data, sshc, SSH_SESSION_FREE);
index 79f972be12df4abbab85400d1fe07d3cac05c857..aa37814e0629e0bb6366ab704e0585384f8b8720 100644 (file)
@@ -35,10 +35,8 @@ static FILE *keylog_file_fp;
 
 void Curl_tls_keylog_open(void)
 {
-  char *keylog_file_name;
-
   if(!keylog_file_fp) {
-    keylog_file_name = curl_getenv("SSLKEYLOGFILE");
+    char *keylog_file_name = curl_getenv("SSLKEYLOGFILE");
     if(keylog_file_name) {
       keylog_file_fp = curlx_fopen(keylog_file_name, FOPEN_APPENDTEXT);
       if(keylog_file_fp) {
index 9958e1030375c53a6d54ee05fce8c695c2818cef..71f792962d711a93a147b5ffb5588b01b13fbf49 100644 (file)
@@ -2946,7 +2946,7 @@ static CURLcode ossl_windows_load_anchors(struct Curl_cfilter *cf,
   /* Import certificates from the Windows root certificate store if
      requested.
      https://stackoverflow.com/questions/9507184/
-     https://github.com/d3x0r/SACK/blob/master/src/netlib/ssl_layer.c#L1037
+     https://github.com/d3x0r/SACK/blob/ff15424d3c581b86d40f818532e5a400c516d39d/src/netlib/ssl_layer.c#L1410
      https://datatracker.ietf.org/doc/html/rfc5280 */
   const char *win_stores[] = {
     "ROOT",   /* Trusted Root Certification Authorities */
index 7bfbbcf04c852dc2193e36e29d70938f4c5a5bc5..05bd6a5194d712d2e7ffa2a374fe835b3cf27b60 100644 (file)
@@ -175,20 +175,20 @@ static CURLcode schannel_set_ssl_version_min_max(DWORD *enabled_protocols,
   for(; i <= (ssl_version_max >> 16); ++i) {
     switch(i) {
     case CURL_SSLVERSION_TLSv1_0:
-      (*enabled_protocols) |= SP_PROT_TLS1_0_CLIENT;
+      *enabled_protocols |= SP_PROT_TLS1_0_CLIENT;
       break;
     case CURL_SSLVERSION_TLSv1_1:
-      (*enabled_protocols) |= SP_PROT_TLS1_1_CLIENT;
+      *enabled_protocols |= SP_PROT_TLS1_1_CLIENT;
       break;
     case CURL_SSLVERSION_TLSv1_2:
-      (*enabled_protocols) |= SP_PROT_TLS1_2_CLIENT;
+      *enabled_protocols |= SP_PROT_TLS1_2_CLIENT;
       break;
     case CURL_SSLVERSION_TLSv1_3:
 
       /* Windows Server 2022 and newer */
       if(curlx_verify_windows_version(10, 0, 20348, PLATFORM_WINNT,
                                       VERSION_GREATER_THAN_EQUAL)) {
-        (*enabled_protocols) |= SP_PROT_TLS1_3_CLIENT;
+        *enabled_protocols |= SP_PROT_TLS1_3_CLIENT;
         break;
       }
       else { /* Windows 10 and older */
@@ -277,7 +277,7 @@ static int get_alg_id_by_name(const char *name)
   return 0; /* not found */
 }
 
-#define NUM_CIPHERS 47 /* There are 47 options listed above */
+#define NUM_CIPHERS 47 /* There are a maximum of 47 options listed above */
 
 static CURLcode set_ssl_ciphers(SCHANNEL_CRED *schannel_cred, char *ciphers,
                                 ALG_ID *algIds)
index 146ea383abcd4dd54c34b55db4e2a64457f1d4c6..bed3a13ec8bf2fba1ddcd1bb853170470d806fae 100644 (file)
@@ -1684,7 +1684,7 @@ struct Curl_cftype Curl_cft_ssl = {
 
 struct Curl_cftype Curl_cft_ssl_proxy = {
   "SSL-PROXY",
-  CF_TYPE_SSL|CF_TYPE_PROXY,
+  CF_TYPE_SSL | CF_TYPE_PROXY,
   CURL_LOG_LVL_NONE,
   ssl_cf_destroy,
   ssl_cf_connect,
index 316a2f21c15dddf2dd605ffce1f3f8fcbb2da243..7b83dd542a69f34fe40173caca089f3a10a11274 100644 (file)
@@ -403,7 +403,8 @@ static CURLcode utf8asn1str(struct dynbuf *to, int type, const char *from,
  *
  * @unittest 1666
  */
-UNITTEST CURLcode encodeOID(struct dynbuf *buf, const char *b, const char *e);
+UNITTEST CURLcode encodeOID(struct dynbuf *store,
+                            const char *beg, const char *end);
 UNITTEST CURLcode encodeOID(struct dynbuf *store,
                             const char *beg, const char *end)
 {
index 5823ce91ac920cb7bc517fb468cde8116054adf8..9d80f2f5384aaeab3a110eaf417fcec65e0dc5a1 100644 (file)
@@ -418,7 +418,7 @@ struct SocketIFace *ISocket = NULL;
 #  else
 struct Library *SocketBase = NULL;
 #  endif
-#  define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
+#  define select(a, b, c, d, e)  WaitSelect(a, b, c, d, e, 0)
 #endif
 /* includes end */"
   AC_CHECK_HEADERS(
index 3f9cb46d8d0478a53b61f221defe8bd83b1a4dd0..5ed7a3ece14e9d401694c60c76df9bd9f45c9469 100755 (executable)
@@ -219,9 +219,8 @@ if(@exact) {
 }
 
 # Build a single combined regex for removing whitelisted content
-my $re_wl;
 my $pat = join('|', map { $_ } @whitelist);
-$re_wl = qr/($pat)/;
+my $re_wl = qr/($pat)/;
 
 my $errors = 0;
 
index 7b260927418e239fa5afa022695fb1679b216e99..02b0232c47c23ed6ab39d70ced64e845fe86874e 100755 (executable)
@@ -120,7 +120,7 @@ my $numchanges = 0;
 my $numbugfixes = 0;
 my $numcontributors = 0;
 open(F, "<RELEASE-NOTES");
-my $mode=0;
+my $mode = 0;
 while(<F>) {
     if($_ =~ /following changes:/) {
         $mode=1;
@@ -175,7 +175,7 @@ printf "Added files:                    %d (total %d)\n",
 printf "Deleted files:                  %d (delta: %d)\n", $deletes,
     $creates - $deletes;
 print "Diffstat:$diffstat" if(!$fileschanged);
-printf "Files changed:                  %d (%.2f%%)\n", $fileschanged, $fileschanged*100/$afiles;
+printf "Files changed:                  %d (%.2f%%)\n", $fileschanged, $fileschanged * 100 / $afiles;
 printf "Lines inserted:                 %d\n", $insertions;
 printf "Lines deleted:                  %d (delta: %d)\n", $deletions,
     $insertions - $deletions;
index 90cbdcea399f4333e07bc6386cdbde85c23a4c43..515df19073c998502dfc6a9705da71514aa32db8 100644 (file)
  * SPDX-License-Identifier: curl
  *
  ***************************************************************************/
-#include <stddef.h>
 #include "tool_setup.h"
 
+#include <stddef.h>
+
 #include "tool_cfgable.h"
 #include "tool_formparse.h"
 #include "tool_libinfo.h"
index 2745a2eb3ccf7363ecfeacfbae93c1c368dc155f..146a27377314c3b6f80c227be62ff5c1631df56d 100644 (file)
@@ -62,7 +62,7 @@ static const struct finder conf_list[] = {
 
 static char *checkhome(const char *home, const char *fname, bool dotscore)
 {
-  const char pref[2] = { '.', '_' };
+  static const char pref[2] = { '.', '_' };
   int i;
   for(i = 0; i < (dotscore ? 2 : 1); i++) {
     char *c;
index 68e7a9fe97d369fa4570726b7e4c2af3ede9faa5..30163561ea8fc75dbc2f7e3825cb282805f8e928 100644 (file)
@@ -124,7 +124,7 @@ static const struct LongShort aliases[]= {
   {"dns-servers",                ARG_STRG, ' ', C_DNS_SERVERS},
   {"doh-cert-status",            ARG_BOOL|ARG_TLS, ' ', C_DOH_CERT_STATUS},
   {"doh-insecure",               ARG_BOOL|ARG_TLS, ' ', C_DOH_INSECURE},
-  {"doh-url"        ,            ARG_STRG, ' ', C_DOH_URL},
+  {"doh-url",                    ARG_STRG, ' ', C_DOH_URL},
   {"dump-ca-embed",              ARG_NONE|ARG_TLS, ' ', C_DUMP_CA_EMBED},
   {"dump-header",                ARG_FILE, 'D', C_DUMP_HEADER},
   {"ech",                        ARG_STRG|ARG_TLS, ' ', C_ECH},
@@ -246,7 +246,8 @@ static const struct LongShort aliases[]= {
   {"proxy-ca-native",            ARG_BOOL|ARG_TLS, ' ', C_PROXY_CA_NATIVE},
   {"proxy-cacert",               ARG_FILE|ARG_TLS, ' ', C_PROXY_CACERT},
   {"proxy-capath",               ARG_FILE|ARG_TLS, ' ', C_PROXY_CAPATH},
-  {"proxy-cert",                ARG_FILE|ARG_TLS|ARG_CLEAR, ' ', C_PROXY_CERT},
+  {"proxy-cert",                 ARG_FILE|ARG_TLS|ARG_CLEAR, ' ',
+   C_PROXY_CERT},
   {"proxy-cert-type",            ARG_STRG|ARG_TLS, ' ', C_PROXY_CERT_TYPE},
   {"proxy-ciphers",              ARG_STRG|ARG_TLS, ' ', C_PROXY_CIPHERS},
   {"proxy-crlfile",              ARG_FILE|ARG_TLS, ' ', C_PROXY_CRLFILE},
index adcc0c42126c9a985aadda64e268af71b9f4ce7a..5a5382c00701cce79d2580c4ec3a4a12f810700b 100644 (file)
@@ -132,7 +132,6 @@ size_t feature_count;
  * the latter is not returned by curl_version_info(), it is built from
  * the returned features bit mask.
  */
-
 CURLcode get_libcurl_info(void)
 {
   CURLcode result = CURLE_OK;
@@ -197,7 +196,6 @@ CURLcode get_libcurl_info(void)
  * a given protocol and thus allows comparing pointers rather than strings.
  * In addition, the returned pointer is not deallocated until the program ends.
  */
-
 const char *proto_token(const char *proto)
 {
   const char * const *builtin;
index 11b33eb3cee4c823d7fee71245bdfe8e3f3cfe37..1f5eb60512807c7841c10f81b428d36929ce7a69 100644 (file)
@@ -576,8 +576,8 @@ static CURLcode retrycheck(struct OperationConfig *config,
         /* We have written data to an output file, we truncate file */
         fflush(outs->stream);
         notef("Throwing away %" CURL_FORMAT_CURL_OFF_T " bytes", outs->bytes);
-        /* truncate file at the position where we started appending */
 
+        /* truncate file at the position where we started appending */
         if(toolx_ftruncate(fileno(outs->stream), outs->init)) {
           /* when truncate fails, we cannot append as then we
              create something strange, bail out */
index b5838f856450334241aa5c1d69080c73ce18c4db..5a8a3bc4dbd15c3efc39064038e2ca2d7cc540dd 100644 (file)
@@ -96,7 +96,7 @@ int toolx_ftruncate_win32(int fd, curl_off_t where)
 }
 #elif defined(__DJGPP__)
 /*
- * Only supports 'off_t' (signed 32 bit) as file size.
+ * Only supports 'off_t' (signed 32-bit) as file size.
  */
 int toolx_ftruncate_djgpp(int fd, curl_off_t where)
 {
index 1b3040ce22a1377b03a5be61390273d7afc57be1..d0aade56f61b458aaa904592aedaf57757fab268 100644 (file)
@@ -137,7 +137,7 @@ static CURLcode test_cli_h2_upgrade_extreme(const char *URL)
         }
         curl_multi_remove_handle(multi, msg->easy_handle);
         curl_easy_cleanup(msg->easy_handle);
-        curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
+        curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
                       "(%d now running)\n", xfer_id, running_handles);
       }
     }
index 82ce28c3feda1b0877ea8736ee50b3a16aeacc8d..031d4cfc2ac600753e86172f130382a5359fe055 100644 (file)
@@ -221,7 +221,7 @@ static CURLcode test_cli_tls_session_reuse(const char *URL)
         curl_multi_remove_handle(multi, msg->easy_handle);
         curl_easy_cleanup(msg->easy_handle);
         --ongoing;
-        curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T" retiring "
+        curl_mfprintf(stderr, "transfer #%" CURL_FORMAT_CURL_OFF_T " retiring "
                       "(%d now running)\n", xfer_id, running_handles);
       }
     }
index 781f59b241409d9ec68877afada9cdaccbd1844d..f35d62eb1e464846891d3bb1e4acdd14856b40df 100644 (file)
@@ -240,7 +240,7 @@ static const struct testcase get_parts_list[] = {
    0, 0, CURLUE_OK},
   {"https://curl.se/#  ",
    "https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20",
-   CURLU_URLENCODE|CURLU_ALLOW_SPACE, 0, CURLUE_OK},
+   CURLU_URLENCODE | CURLU_ALLOW_SPACE, 0, CURLUE_OK},
   {"", "", 0, 0, CURLUE_MALFORMED_INPUT},
   {" ", "", 0, 0, CURLUE_MALFORMED_INPUT},
   {"1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
@@ -261,7 +261,7 @@ static const struct testcase get_parts_list[] = {
    CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
   {"https://user@example.net?hello# space ",
    "https | user | [12] | [13] | example.net | [15] | / | hello | %20space%20",
-   CURLU_ALLOW_SPACE|CURLU_URLENCODE, 0, CURLUE_OK},
+   CURLU_ALLOW_SPACE | CURLU_URLENCODE, 0, CURLUE_OK},
   {"https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME},
   {"https://example.com%252f%40@example.net",
    "https | example.com%2f@ | [12] | [13] | example.net | [15] | / "
@@ -387,7 +387,7 @@ static const struct testcase get_parts_list[] = {
    CURLU_DEFAULT_SCHEME, 0, CURLUE_MALFORMED_INPUT},
   /* no space allowed in scheme */
   {"htt ps://user:password@example.net/get?this=and-what", "",
-   CURLU_NON_SUPPORT_SCHEME|CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
+   CURLU_NON_SUPPORT_SCHEME | CURLU_ALLOW_SPACE, 0, CURLUE_BAD_SCHEME},
   {"https://user:password@example.net/get?this=and what",
    "https | user | password | [13] | example.net | [15] | /get | "
    "this=and what | [17]",
@@ -472,7 +472,7 @@ static const struct testcase get_parts_list[] = {
    CURLU_DEFAULT_SCHEME, 0, CURLUE_NO_HOST},
   {"boing:80",
    "https | [11] | [12] | [13] | boing | 80 | / | [16] | [17]",
-   CURLU_DEFAULT_SCHEME|CURLU_GUESS_SCHEME, 0, CURLUE_OK},
+   CURLU_DEFAULT_SCHEME | CURLU_GUESS_SCHEME, 0, CURLUE_OK},
   {"http://[fd00:a41::50]:8080",
    "http | [11] | [12] | [13] | [fd00:a41::50] | 8080 | / | [16] | [17]",
    CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
@@ -1433,11 +1433,11 @@ static const struct redircase set_url_list[] = {
   {"http://example.com/please/../gimme/%TESTNUMBER?foobar#hello",
    "http://example.net/there/it/is/../../tes t case=/%TESTNUMBER0002? yes no",
    "http://example.net/there/tes%20t%20case=/%TESTNUMBER0002?+yes+no",
-   0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
+   0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
   {"http://local.test?redirect=http://local.test:80?-321",
    "http://local.test:80?-123",
    "http://local.test:80/?-123",
-   0, CURLU_URLENCODE|CURLU_ALLOW_SPACE, CURLUE_OK},
+   0, CURLU_URLENCODE | CURLU_ALLOW_SPACE, CURLUE_OK},
   {"http://local.test?redirect=http://local.test:80?-321",
    "http://local.test:80?-123",
    "http://local.test:80/?-123",
index fd4207cca2b8e252c7f56c12ac0b674919fe9eeb..e09ff349b3e7af2020c986fe099a69cee6d1da0a 100644 (file)
@@ -27,7 +27,7 @@ static CURLcode test_lib1965(const char *URL)
 {
   CURLcode result = CURLE_OK;
   CURLUcode rc;
-  const char *schemes[] = {
+  static const char *schemes[] = {
     "bad!", "bad{", "bad/", "bad\\", "a!",
     "a+123", "http-2", "http.1",
     "a+-.123", "http-+++2", "http.1--",
@@ -35,9 +35,9 @@ static CURLcode test_lib1965(const char *URL)
     "ABC2", "2CBA", "", "a",
     "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd",
     "aaaaaaaaaabbbbbbbbbbccccccccccdddddddddde",
-    NULL};
+    NULL };
   int i;
-  (void) URL;
+  (void)URL;
 
   global_init(CURL_GLOBAL_ALL);
 
index 1b894bd9713f11a02194d39801006308154d7506..765488f36ec632ba487e3f778fcabc898915e246 100644 (file)
@@ -34,7 +34,7 @@ static bool is_chain_in_order(struct curl_certinfo *cert_info)
 
   /* Chains with only a single certificate are always in order */
   if(cert_info->num_of_certs <= 1)
-    return 1;
+    return true;
 
   /* Enumerate each certificate in the chain */
   for(cert = 0; cert < cert_info->num_of_certs; cert++) {
index b6c3d3a468a4867ba16a3745116d5f3ed879b7b2..ba22a9bab54e3dc51035953f6d5a00cb8c778fc3 100644 (file)
@@ -163,26 +163,26 @@ static CURLcode test_lib517(const char *URL)
 #if SIZEOF_TIME_T > 4
     { "2094 Nov 6 08:49:37", 3939871777 },
 #endif
-    { "01 Jan 2001 8:0:0", 978336000},
-    { "01 Jan 2001 8:00:0", 978336000},
+    { "01 Jan 2001 8:0:0", 978336000 },
+    { "01 Jan 2001 8:00:0", 978336000 },
     /* Out-of-range day-of-month Cases */
-    { "29 Feb 2023 12:00:00 GMT", 1677672000},
-    { "31 Apr 2024 12:00:00 GMT", 1714564800},
-    { "30 Feb 2024 12:00:00 GMT", 1709294400},
-    { "01-13-2024", -1},
-    { "32 Jan 2024", -1},
-    { "31 Jan 2024", 1706659200},
-    { "32 Feb 2024", -1},
-    { "32 Mar 2024", -1},
-    { "32 Apr 2024", -1},
-    { "32 May 2024", -1},
-    { "32 Jun 2024", -1},
-    { "32 Jul 2024", -1},
-    { "32 Aug 2024", -1},
-    { "32 Sep 2024", -1},
-    { "32 Oct 2024", -1},
-    { "32 Nov 2024", -1},
-    { "32 Dec 2024", -1},
+    { "29 Feb 2023 12:00:00 GMT", 1677672000 },
+    { "31 Apr 2024 12:00:00 GMT", 1714564800 },
+    { "30 Feb 2024 12:00:00 GMT", 1709294400 },
+    { "01-13-2024", -1 },
+    { "32 Jan 2024", -1 },
+    { "31 Jan 2024", 1706659200 },
+    { "32 Feb 2024", -1 },
+    { "32 Mar 2024", -1 },
+    { "32 Apr 2024", -1 },
+    { "32 May 2024", -1 },
+    { "32 Jun 2024", -1 },
+    { "32 Jul 2024", -1 },
+    { "32 Aug 2024", -1 },
+    { "32 Sep 2024", -1 },
+    { "32 Oct 2024", -1 },
+    { "32 Nov 2024", -1 },
+    { "32 Dec 2024", -1 },
     /* Timezone Offsets */
     { "Sun, 06 Nov 1994 08:49:37 +0530", 784091977 },
     { "Sun, 06 Nov 1994 08:49:37 +0545", 784091077 },
@@ -221,18 +221,18 @@ static CURLcode test_lib517(const char *URL)
     /* Y2K38 & Historical Boundaries */
 #if SIZEOF_TIME_T > 4
     /* for 32 bit time_t, we bail on >year 2037 */
-    { "19 Jan 2038 03:14:07 GMT", 2147483647},
-    { "19 Jan 2038 03:14:08 GMT", 2147483648},
-    { "01 Jan 69 00:00:00 GMT", 3124224000},
+    { "19 Jan 2038 03:14:07 GMT", 2147483647 },
+    { "19 Jan 2038 03:14:08 GMT", 2147483648 },
+    { "01 Jan 69 00:00:00 GMT", 3124224000 },
 #endif
-    { "01 Jan 1500 00:00:00 GMT", -1},
+    { "01 Jan 1500 00:00:00 GMT", -1 },
     /* Formatting & Malformed Junk */
-    { "Sun, 06-Nov/1994 08:49:37", 784111777},
-    { "Sun,    06 Nov   1994   08:49:37 GMT", 784111777},
-    { "  Sun, 06 Nov 1994 08:49:37 GMT  ", 784111777},
-    { "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1},
+    { "Sun, 06-Nov/1994 08:49:37", 784111777 },
+    { "Sun,    06 Nov   1994   08:49:37 GMT", 784111777 },
+    { "  Sun, 06 Nov 1994 08:49:37 GMT  ", 784111777 },
+    { "Date: Sun, 06 Nov 1994 08:49:37 GMT", -1 },
     /* wrong day name is ignored */
-    { "Monday, 06 Nov 1994 08:49:37 GMT", 784111777},
+    { "Monday, 06 Nov 1994 08:49:37 GMT", 784111777 },
     { NULL, 0 }
   };
 
index a6a816820bf4e7b055b5741fd55ebf2bc15fd874..f3d0c088e86d527b1a892f2a75c1af0980fe5955 100755 (executable)
@@ -375,7 +375,7 @@ static CURLcode test_lib1521(const char *URL)
   curl_socket_t sockfd;
   const struct curl_certinfo *certinfo;
   struct curl_tlssessioninfo *tlssession;
-  struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0};
+  struct curl_blob blob = { CURL_UNCONST("silly"), 5, 0 };
   CURLcode result = CURLE_OK;
   (void)URL;
   global_init(CURL_GLOBAL_ALL);
@@ -455,7 +455,7 @@ while(<STDIN>) {
                    "${w3}  curl_easy_setopt(curl, $name,";
         my $ignoreset = "${w3}/* set string again to check for leaks */\n".
             "${w3}(void)curl_easy_setopt(curl, $name,";
-        my $i = ' ' x (length($w) + 25);
+        my $i = ' ' x (length($w) + 21);
         my $fcheck = <<MOO
     if(first && present(first)) /* first setopt check only */
       err("$name", first, __LINE__);
@@ -515,7 +515,7 @@ MOO
         elsif($type eq "CURLOPTTYPE_OFF_T") {
             print $fh "${fpref} OFF_NO);\n$flongcheckzero";
             print $fh "$ifpresent";
-            my $lvl = " " x 29;
+            my $lvl = " " x 25;
             print $fh "${pref}\n${lvl}(curl_off_t)22);\n$longcheck";
             print $fh "${pref} OFF_HI);\n$longcheck";
             print $fh "${pref} OFF_LO);\n$longcheck";
index a3745c108bc435132dab2feccd387c0a6dc22711..e03e99af43648304ae6dcfb8da7b8d6aa2f90e3d 100755 (executable)
@@ -36,7 +36,7 @@ my $what=$ARGV[2];
 
 # Read the output of curl --version
 my $curl_protocols="";
-open(CURL, "$ARGV[1]") || die "Cannot get curl $what list\n";
+open(CURL, $ARGV[1]) || die "Cannot get curl $what list\n";
 while(<CURL>) {
     $curl_protocols = $_ if(/$what:/i);
 }
index 31fb98f1a4af376bba9737d88f43bd49490d680a..c25ae3ce6c281763e42fd7e10c63248a8fb6ee4b 100755 (executable)
@@ -34,7 +34,7 @@ if($#ARGV != 2) {
 my $what=$ARGV[2];
 
 # Read the output of curl --version
-open(CURL, "$ARGV[1]") || die "Cannot open curl --version list in $ARGV[1]\n";
+open(CURL, $ARGV[1]) || die "Cannot open curl --version list in $ARGV[1]\n";
 $_ = <CURL>;
 chomp;
 /libcurl\/([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)/;
index 9836202082793041b85decc64b6b4da58cbd7374..e481255a3a559ac8aed18619daf3b0cf7bce9e19 100644 (file)
@@ -173,8 +173,8 @@ sub exe_ext {
     if($ENV{'CURL_TEST_EXE_EXT'}) {
         return $ENV{'CURL_TEST_EXE_EXT'};
     }
-    if($ENV{'CURL_TEST_EXE_EXT_'.$component}) {
-        return $ENV{'CURL_TEST_EXE_EXT_'.$component};
+    if($ENV{'CURL_TEST_EXE_EXT_' . $component}) {
+        return $ENV{'CURL_TEST_EXE_EXT_' . $component};
     }
     if($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'msys' ||
        $^O eq 'dos' || $^O eq 'os2') {
index 2ecaba8ef477153af9a3debd2bb7ee7dee6eb641..c9aab65348c5c128d9ade72868d12fc188985a45 100644 (file)
@@ -114,9 +114,9 @@ use memanalyzer;
 #######################################################################
 # Global variables set elsewhere but used only by this package
 # These may only be set *before* runner_init is called
-our $DBGCURL=$CURL; #"../src/.libs/curl";  # alternative for debugging
-our $valgrind_logfile="--log-file";  # the option name for valgrind >=3
-our $valgrind_tool="--tool=memcheck";
+our $DBGCURL = $CURL; #"../src/.libs/curl";  # alternative for debugging
+our $valgrind_logfile = "--log-file";  # the option name for valgrind >=3
+our $valgrind_tool = "--tool=memcheck";
 our $gdb = checktestcmd("gdb");
 our $gdbthis = 0;  # run test case with debugger (gdb or lldb)
 our $gdbxwin;      # use windowed gdb when using gdb
@@ -142,12 +142,12 @@ my %controllerw;    # pipe that controller writes to
 
 # redirected stdout/stderr to these files
 sub stdoutfilename {
-    my ($logdir, $testnum)=@_;
+    my ($logdir, $testnum) = @_;
     return "$logdir/stdout$testnum";
 }
 
 sub stderrfilename {
-    my ($logdir, $testnum)=@_;
+    my ($logdir, $testnum) = @_;
     return "$logdir/stderr$testnum";
 }
 
@@ -157,19 +157,19 @@ sub stderrfilename {
 # runnerac_* functions
 # Called by controller
 sub runner_init {
-    my ($logdir, $jobs)=@_;
+    my ($logdir, $jobs) = @_;
 
     $multiprocess = !!$jobs;
 
     # enable memory debugging if curl is compiled with it
     $ENV{'CURL_MEMDEBUG'} = "$logdir/$MEMDUMP";
     delete $ENV{'CURL_ENTROPY'} if($ENV{'CURL_ENTROPY'});
-    $ENV{'CURL_FORCETIME'}=1; # for debug NTLM magic
-    $ENV{'CURL_GLOBAL_INIT'}=1; # debug curl_global_init/cleanup use
-    $ENV{'HOME'}=$pwd;
-    $ENV{'CURL_HOME'}=$ENV{'HOME'};
-    $ENV{'XDG_CONFIG_HOME'}=$ENV{'HOME'};
-    $ENV{'COLUMNS'}=79; # screen width!
+    $ENV{'CURL_FORCETIME'} = 1; # for debug NTLM magic
+    $ENV{'CURL_GLOBAL_INIT'} = 1; # debug curl_global_init/cleanup use
+    $ENV{'HOME'} = $pwd;
+    $ENV{'CURL_HOME'} = $ENV{'HOME'};
+    $ENV{'XDG_CONFIG_HOME'} = $ENV{'HOME'};
+    $ENV{'COLUMNS'} = 79; # screen width!
 
     # Incorporate the $logdir into the random seed and re-seed the PRNG.
     # This gives each runner a unique yet consistent seed which provides
@@ -262,8 +262,8 @@ sub event_loop {
 # Check for a command in the PATH of the machine running curl.
 #
 sub checktestcmd {
-    my ($cmd)=@_;
-    my @testpaths=($LIBDIR . ".libs", $LIBDIR);
+    my ($cmd) = @_;
+    my @testpaths = ($LIBDIR . ".libs", $LIBDIR);
     return checkcmd($cmd, @testpaths);
 }
 
@@ -452,7 +452,7 @@ sub torture {
     logmsg " CMD: $testcmd\n" if($verbose);
 
     # memanalyze -v is our friend, get the number of allocations made
-    my $count=0;
+    my $count = 0;
     my @out = memanalyze("$LOGDIR/$MEMDUMP", 1, 0, 0);
     for(@out) {
         if(/^Operations: (\d+)/) {
@@ -498,7 +498,7 @@ sub torture {
         }
 
         if($verbose) {
-            my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+            my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
                 localtime(time());
             my $now = sprintf("%02d:%02d:%02d ", $hour, $min, $sec);
             logmsg "Fail function no: $limit at $now\r";
@@ -550,16 +550,16 @@ sub torture {
         # and does not core dump
         if(($ret & 255) || ($ret >> 8) >= 128) {
             logmsg " system() returned $ret\n";
-            $fail=1;
+            $fail = 1;
         }
         else {
             my @memdata = memanalyze("$LOGDIR/$MEMDUMP", 0, 0, 0);
-            my $leak=0;
+            my $leak = 0;
             for(@memdata) {
                 if($_ ne "") {
                     # well it could be other memory problems as well, but
                     # we call it leak for short here
-                    $leak=1;
+                    $leak = 1;
                 }
             }
             if($leak) {
@@ -753,9 +753,9 @@ sub singletest_prepare {
 
     # create (possibly-empty) files before starting the test
     for my $partsuffix (('', '1', '2', '3', '4')) {
-        my @inputfile=getpart("client", "file".$partsuffix);
+        my @inputfile = getpart("client", "file".$partsuffix);
         my %fileattr = getpartattr("client", "file".$partsuffix);
-        my $filename=$fileattr{'name'};
+        my $filename = $fileattr{'name'};
         if(@inputfile || $filename) {
             if(!$filename) {
                 logmsg " $testnum: IGNORED: Section client=>file has no name attribute\n";
@@ -812,25 +812,25 @@ sub singletest_run {
     }
     else {
         # there was no command given, use something silly
-        $cmd="-";
+        $cmd = "-";
     }
 
-    my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
+    my $CURLOUT = "$LOGDIR/curl$testnum.out"; # curl output if not stdout
 
     # if stdout section exists, we verify that the stdout contained this:
-    my $out="";
+    my $out = "";
     my %cmdhash = getpartattr("client", "command");
     if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
         #We may slap on --output!
         if(!partexists("verify", "stdout") ||
                 ($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) {
-            $out=" --output $CURLOUT ";
+            $out = " --output $CURLOUT ";
         }
     }
 
     my @codepieces = getpart("client", "tool");
-    my $tool="";
-    my $tool_name="";  # without exe extension
+    my $tool = "";
+    my $tool_name = "";  # without exe extension
     if(@codepieces) {
         $tool_name = $codepieces[0];
         chomp $tool_name;
@@ -839,27 +839,27 @@ sub singletest_run {
 
     my $oldmemdebug;
     my $disablevalgrind;
-    my $CMDLINE="";
+    my $CMDLINE = "";
     my $cmdargs;
     my $cmdtype = $cmdhash{'type'} || "default";
     my $fail_due_event_based = $run_event_based;
     if($cmdtype eq "perl") {
         # run the command line prepended with "perl"
-        $cmdargs =$cmd;
+        $cmdargs = $cmd;
         $CMDLINE = "$perl ";
-        $tool=$CMDLINE;
-        $disablevalgrind=1;
+        $tool = $CMDLINE;
+        $disablevalgrind = 1;
     }
     elsif($cmdtype eq "shell") {
         # run the command line prepended with "/bin/sh"
-        $cmdargs =$cmd;
+        $cmdargs = $cmd;
         $CMDLINE = "/bin/sh ";
-        $tool=$CMDLINE;
-        $disablevalgrind=1;
+        $tool = $CMDLINE;
+        $disablevalgrind = 1;
     }
     elsif(!$tool && !$keywords{"unittest"}) {
         # run curl, add suitable command line options
-        my $inc="";
+        my $inc = "";
         if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-include/)) {
             $inc = " --include";
         }
@@ -899,21 +899,21 @@ sub singletest_run {
 
         # Default the tool to a unit test with the same name as the test spec
         if($keywords{"unittest"} && !$tool) {
-            $tool_name="unit$testnum";
+            $tool_name = "unit$testnum";
             $tool = $tool_name . exe_ext('TOOL');
         }
 
         if($tool =~ /^lib/) {
             $tool = "libtests" . exe_ext('TOOL');
-            $CMDLINE=$LIBDIR . $tool;
+            $CMDLINE = $LIBDIR . $tool;
         }
         elsif($tool =~ /^tool/) {
             $tool = "tunits" . exe_ext('TOOL');
-            $CMDLINE=$TUNITDIR . $tool;
+            $CMDLINE = $TUNITDIR . $tool;
         }
         elsif($tool =~ /^unit/) {
             $tool = "units" . exe_ext('TOOL');
-            $CMDLINE=$UNITDIR . $tool;
+            $CMDLINE = $UNITDIR . $tool;
         }
 
         if(! -f $CMDLINE) {
@@ -921,16 +921,16 @@ sub singletest_run {
             return (-1, 0, 0, "", "", 0);
         }
 
-        $CMDLINE=exerunner() . $CMDLINE;
+        $CMDLINE = exerunner() . $CMDLINE;
 
         if($gdbthis) {
-            $cmdargs =" $tool_name$cmdargs";
+            $cmdargs = " $tool_name$cmdargs";
         }
         else {
-            $CMDLINE.=" $tool_name";
+            $CMDLINE .= " $tool_name";
         }
 
-        $DBGCURL=$CMDLINE;
+        $DBGCURL = $CMDLINE;
     }
 
     if($fail_due_event_based) {
@@ -942,13 +942,13 @@ sub singletest_run {
         # gdb is incompatible with valgrind, so disable it when debugging
         # Perhaps a better approach would be to run it under valgrind anyway
         # with --db-attach=yes or --vgdb=yes.
-        $disablevalgrind=1;
+        $disablevalgrind = 1;
     }
 
     my @stdintest = getpart("client", "stdin");
 
     if(@stdintest) {
-        my $stdinfile="$LOGDIR/stdin-for-$testnum";
+        my $stdinfile = "$LOGDIR/stdin-for-$testnum";
 
         my %hash = getpartattr("client", "stdin");
         if($hash{'nonewline'}) {
@@ -966,7 +966,7 @@ sub singletest_run {
     }
 
     if(!$tool) {
-        $CMDLINE=exerunner() . shell_quote($CURL);
+        $CMDLINE = exerunner() . shell_quote($CURL);
         if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-q/)) {
             $CMDLINE .= " -q";
         }
@@ -1038,13 +1038,13 @@ sub singletest_run {
         # gdb
         my $GDBW = ($gdbxwin) ? "-w" : "";
         runclient("$gdb --directory $LIBDIR " . shell_quote($DBGCURL) . " $GDBW -x $LOGDIR/gdbcmd");
-        $cmdres=0; # makes it always continue after a debugged run
+        $cmdres = 0; # makes it always continue after a debugged run
     }
     elsif($gdbthis == 2) {
         # $gdb is "lldb"
         print "runs lldb -- $CURL $cmdargs\n";
         runclient("lldb -- $CURL $cmdargs");
-        $cmdres=0; # makes it always continue after a debugged run
+        $cmdres = 0; # makes it always continue after a debugged run
     }
     else {
         # Convert the raw result code into a more useful one
@@ -1065,7 +1065,7 @@ sub singletest_run {
 #######################################################################
 # Clean up after test command
 sub singletest_clean {
-    my ($testnum, $dumped_core, $testtimings)=@_;
+    my ($testnum, $dumped_core, $testtimings) = @_;
 
     if(!$dumped_core) {
         if(-r "core") {
@@ -1138,15 +1138,15 @@ sub singletest_clean {
 #######################################################################
 # Verify that the postcheck succeeded
 sub singletest_postcheck {
-    my ($testnum)=@_;
+    my ($testnum) = @_;
 
     # run the postcheck command
-    my @postcheck= getpart("client", "postcheck");
+    my @postcheck = getpart("client", "postcheck");
     if(@postcheck) {
         die "test$testnum uses client/postcheck";
     }
 
-    @postcheck= getpart("verify", "postcheck");
+    @postcheck = getpart("verify", "postcheck");
     if(@postcheck) {
         my $cmd = join("", @postcheck);
         chomp $cmd;
@@ -1173,7 +1173,7 @@ sub singletest_postcheck {
 ###################################################################
 # Get ready to run a single test case
 sub runner_test_preprocess {
-    my ($testnum)=@_;
+    my ($testnum) = @_;
     my %testtimings;
 
     if(clearlogs()) {
@@ -1233,7 +1233,7 @@ sub runner_test_preprocess {
 #   1=unskippable test failure, as first integer, plus any log messages,
 #   plus more return values when error is 0
 sub runner_test_run {
-    my ($testnum)=@_;
+    my ($testnum) = @_;
 
     if(clearlogs()) {
         logmsg "Warning: log messages were lost\n";
@@ -1285,7 +1285,7 @@ sub runner_test_run {
 # received.
 # Called by controller
 sub runnerac_shutdown {
-    my ($runnerid)=$_[0];
+    my ($runnerid) = $_[0];
     my $err = controlleripccall(\&runner_shutdown, @_);
 
     # These have no more use
@@ -1362,7 +1362,7 @@ sub runnerar {
         }
         # system call was interrupted, probably by ^C; restart it so we stay in sync
     }
-    my $len=unpack("L", $datalen);
+    my $len = unpack("L", $datalen);
     my $buf;
     while(! defined ($err = sysread($controllerr{$runnerid}, $buf, $len)) || $err <= 0) {
         if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {
@@ -1391,7 +1391,7 @@ sub runnerar_ready {
     my ($blocking) = @_;
     my $r_in = "";
     my %idbyfileno;
-    my $maxfileno=0;
+    my $maxfileno = 0;
     my @ready_runners = ();
     foreach my $p (keys(%controllerr)) {
         my $fd = fileno($controllerr{$p});
@@ -1408,7 +1408,7 @@ sub runnerar_ready {
     # caller will need to later call this function again.
     # TODO: this is relatively slow with hundreds of fds
     my $e_in = $r_in;
-    if(select(my $r_out=$r_in, undef, my $e_out=$e_in, $blocking) >= 1) {
+    if(select(my $r_out = $r_in, undef, my $e_out = $e_in, $blocking) >= 1) {
         for my $fd (0..$maxfileno) {
             # Return an error condition first in case it is both
             if(vec($e_out, $fd, 1)) {
@@ -1451,7 +1451,7 @@ sub ipcrecv {
         }
         # system call was interrupted, probably by ^C; restart it so we stay in sync
     }
-    my $len=unpack("L", $datalen);
+    my $len = unpack("L", $datalen);
     my $buf;
     while(! defined ($err = sysread($runnerr, $buf, $len)) || $err <= 0) {
         if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) {
index fca0597ec6bd76e815a010a9602cf5018cb9eedc..dba3c3e1d1e13d018dc8070299905d066880b2c6 100644 (file)
@@ -1899,7 +1899,7 @@ sub runsshserver {
        !close($hostfile) ||
        ($SSHSRVMD5 !~ /^[a-f0-9]{32}$/i))
     {
-        my $msg = "Fatal: $srvrname pubkey md5 missing : \"$hstpubmd5f\" : $!";
+        my $msg = "Fatal: $srvrname pubkey MD5 missing : \"$hstpubmd5f\" : $!";
         logmsg "$msg\n";
         stopservers($verb);
         die $msg;
@@ -1909,7 +1909,7 @@ sub runsshserver {
        (read($hostfile, $SSHSRVSHA256, 48) == 0) ||
        !close($hostfile))
     {
-        my $msg = "Fatal: $srvrname pubkey sha256 missing : \"$hstpubsha256f\" : $!";
+        my $msg = "Fatal: $srvrname pubkey SHA256 missing : \"$hstpubsha256f\" : $!";
         logmsg "$msg\n";
         stopservers($verb);
         die $msg;
index e425f92ff0f5f51ecc094511d00b397008cf127a..f74ff0bd2d7e8963231793109cdeaa0fc800a107 100755 (executable)
@@ -446,21 +446,21 @@ if((! -e pp($hstprvkeyf)) || (! -s pp($hstprvkeyf)) ||
     my @rsahostkey = do { local $/ = ' '; <$rsakeyfile> };
     close($rsakeyfile);
     if(!$rsahostkey[1]) {
-        logmsg "Failed parsing base64 encoded RSA host key\n";
+        logmsg "Failed parsing base64 encoded SSH host key\n";
         exit 1;
     }
     open(my $pubmd5file, ">", pp($hstpubmd5f));
     print $pubmd5file md5_hex(decode_base64($rsahostkey[1]));
     close($pubmd5file);
     if((! -e pp($hstpubmd5f)) || (! -s pp($hstpubmd5f))) {
-        logmsg "Failed writing md5 hash of RSA host key\n";
+        logmsg "Failed writing MD5 hash of SSH host key\n";
         exit 1;
     }
     open(my $pubsha256file, ">", pp($hstpubsha256f));
     print $pubsha256file sha256_base64(decode_base64($rsahostkey[1]));
     close($pubsha256file);
     if((! -e pp($hstpubsha256f)) || (! -s pp($hstpubsha256f))) {
-        logmsg "Failed writing sha256 hash of RSA host key\n";
+        logmsg "Failed writing SHA256 hash of SSH host key\n";
         exit 1;
     }
 }
index 796a2816cae1a6df8bbbcfb9b6204c7317a4dd14..9004696f6f55c0055d40179efa36e0cffc4993f8 100755 (executable)
@@ -81,7 +81,7 @@ sub scanenum {
 
 sub scanheader {
     my ($f)=@_;
-    open my $h, "<", $f;
+    open(my $h, "<", $f);
     while(<$h>) {
         if(/^#define ((LIB|)CURL[A-Za-z0-9_]*)/) {
             push @syms, $1;
@@ -120,7 +120,7 @@ sub checkmanpage {
             my $s = $1;
             # skip two "special" ones
             if($s !~ /(^(CURLE_OBSOLETE|CURLOPT_TEMPLATE))|_$/) {
-                push @manrefs, "$1:$m:$line";
+                push @manrefs, "$s:$m:$line";
             }
         }
         $line++;
@@ -143,7 +143,7 @@ scanallheaders();
 scanman_md_dir("$root/docs/libcurl");
 scanman_md_dir("$root/docs/libcurl/opts");
 
-open my $s, "<", "$root/docs/libcurl/symbols-in-versions";
+open(my $s, "<", "$root/docs/libcurl/symbols-in-versions");
 while(<$s>) {
     if(/(^[^ \n]+) +(.*)/) {
         my ($sym, $rest)=($1, $2);
index 649e19506f1c1468b1db13b9204407d5ef0a51a6..dd0097e3716a146ff6ce3a4e093b15f95b7bba18 100755 (executable)
@@ -119,7 +119,7 @@ sub scanenums {
 sub scanheader {
     my ($f)=@_;
     scanenums($f);
-    open H, "<$f";
+    open(H, '<', $f);
     while(<H>) {
         my ($line, $linenum) = ($_, $.);
         if(/^ *# *define +([^ \n]*)/) {
index 9d97dbb0de8fc1516e75d62ea73a1acae86e8e53..33a5340cd6388f4531b3c3e3e2b554d9ccfbb4f0 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "tool_getparam.h"
 
 static CURLcode test_tool1394(const char *arg)
index 3593fb6f2a86125e5ff6ad92c46433198b66c0b2..f16b0bfe0a271bd0997fe2b3f0e2d8c3af26f35e 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #if defined(_WIN32) || defined(MSDOS)
-
 #include "tool_cfgable.h"
 #include "tool_doswin.h"
 
index ba9e28029446e06fe9d0a9390a7294e99543b6a5..35ac1a3b87994131ebd46bf463e6f8b3067e3afd 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "tool_xattr.h"
 
 static CURLcode test_tool1621(const char *arg)
index de6bcd9633717f1862d5b49cf03393f57bfa76ee..ec585983babf2fab5cf148536bf09c42c429a9aa 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "tool_progress.h"
 
 static CURLcode test_tool1622(const char *arg)
index 2d94c8cebbcce11faa4a2b4edf3b8d13db9444c0..a79ccc97c4bcdefd094485f3ac31d24c940b8efa 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "tool_getparam.h"
 
 struct check1623 {
index a554cd5156130671188cd82cdc7ce24866afa33e..d5f762bad7b8f546d3e6a233186ae00dfa9f454b 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "llist.h"
 
 static void test_Curl_llist_dtor(void *key, void *value)
index c96f05527363bd01f0fcf15424ad7f4bec5efed6..e840486511fca48214b3e04028915682c976cc0b 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "url.h" /* for curlx_safefree */
 
index 2a6b54366d7074013201cb7e1a5985313640da1b..8caa3c75e0952f61618949f8bbc6a3c8ea257a4c 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "connect.h"
 
@@ -50,10 +49,10 @@ static void t1303_stop(struct Curl_easy *easy)
 #define BASE 1000000
 
 /* macro to set the pretended current time */
-#define NOW(x,y) now.tv_sec = x; now.tv_usec = y
+#define NOW(x, y) now.tv_sec = x; now.tv_usec = y
 /* macro to set the millisecond based timeouts to use */
-#define TIMEOUTS(x,y) easy->set.timeout = x; \
-                      easy->set.connecttimeout = y
+#define TIMEOUTS(x, y) easy->set.timeout = x; \
+                       easy->set.connecttimeout = y
 
 /*
  * To test:
index e0e3d60501555a91212f94465a51379b536acb14..72b2ab5a32f6f676ea9347ba9bad2ca070e7d29a 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #ifndef CURL_DISABLE_NETRC
-
 #include "netrc.h"
 
 static void t1304_stop(char **password, char **login)
index 146d5ae7148a4fe3f44cb7fc66e30a000f5f84ed..53377afdb96b91f3a8268be5ef822dabb6951a6b 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #ifndef CURL_DISABLE_FTP
-
 #include "curl_fnmatch.h"
 
 /*
index 5807d497ee1410c586eb367fc31f64ccb8ec2007..b49a5de9948fb38f149f2b1ebeda09e761719f6a 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "splay.h"
 
 static void splayprint(struct Curl_tree *t, int d, char output)
index 8ba973376a993a98a056ac9d65a585ef5a66e9e3..b133f2cc995b0ebc0458d1536c1eaac301a4e204 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "vtls/hostcheck.h"
 
 static CURLcode test_unit1397(const char *arg)
index 9ce182c1547d709ec117555cd00952c412e72b84..e1e472a53682b86adc37ac85a9a75c7f1461ba94 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "progress.h"
 
index 4b53b4e36bf474b1b8d4a520f454b536f42c5329..649e92a4cab4a909eaae048c9a21206bb0c191d8 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "curl_ntlm_core.h"
 
index 1e3cf096be59636b0de83097b86ab35de1096b91..8d41be782245ee9123feb7680effd46b7f8a8d1a 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "curl_md5.h"
 
 static CURLcode test_unit1601(const char *arg)
index 5841717691e0c336498121ab10dd05f64cc7dd04..057ead6dd79acde29e913d999c9ec4b9f5bb9be4 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "hash.h"
 
 static void t1602_mydtor(void *p)
index ed6be10516908dcdbceeccc79764a6b8ed085916..9d7d950d32f1dc6fdbb8c4f435ff86edeef88ca1 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "hash.h"
 
 static const size_t slots = 3;
index d634f0d6dffed14a9a420a3cedb35ccb2f1b577c..8c63dc3b194c08571f726bbeb8dab721d20b1594 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "llist.h"
 
 static CURLcode t1605_setup(CURL **easy)
index d4fefca4f969f37005546642ee9fb8bde19ff741..dc12b99a568454d98da7e29e70c1a89fb39be83e 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "connect.h"
 #include "curl_addrinfo.h"
index da099d72b2c4916b5224e4934bdcba3f56804e10..9d1691863962a5c3e1a9d582bf9bbdfcb3415f33 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "connect.h"
 #include "curl_addrinfo.h"
index a46b7d965bb82cad1b9ea0bfa83d22f0502d3934..eeb3ccceb74d34be39cb45b2830581c627ad0d82 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "curl_sha256.h"
 
 static CURLcode t1610_setup(void)
index 2b483dbd6c4f41ef923c7121bc2dabd1646f034c..c22c5f1689c5b95cc26edd6eb55ead16276632d0 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "curl_md4.h"
 
 static CURLcode test_unit1611(const char *arg)
index dd6f9e0fc08070a829fbb29af1782e59fd4f86d0..cc7c36c4c869bf15ecd1e733e339a23defc620e3 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "curl_hmac.h"
 #include "curl_md5.h"
 
index ed0e3aba9807e211d39be77dbf0f77fbac0d0d17..828de886d0dac75292bbfb0238705fb8b61c8a6f 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "noproxy.h"
 
 static CURLcode test_unit1614(const char *arg)
index cfb1997f1cc1ed7c91709f6b93477d52e93feeff..7e26a158a13ef78767c10179a15a41bf12bc3bee 100644 (file)
@@ -23,7 +23,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "curl_sha512_256.h"
 
 static CURLcode test_unit1615(const char *arg)
index 2b46d862900dec20384a9d254b12ee01738d400a..2ce26b1ed458e04a7c3a80a90ebf0a8eb98ca908 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "url.h"
 
index 031422df63025a23521a75786a81aea35518a29d..ca310cfa518705b7111db306efeeeaa2319b9859 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #ifndef CURL_DISABLE_HTTP
-
 #include "urldata.h"
 #include "url.h"
 
@@ -126,8 +125,7 @@ static CURLcode test_unit1625(const char *arg)
 
   return CURLE_OK;
 }
-#else
-/* for HTTP-disabled builds */
+#else /* CURL_DISABLE_HTTP */
 static CURLcode test_unit1625(const char *arg)
 {
   (void)arg;
index 80bb4d118168f496da128e20c74781bccd2194ba..30189fdf8dcbe5962a4f21749b6a3f7fdf7fdc14 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #ifndef CURL_DISABLE_HTTP
-
 #include "urldata.h"
 #include "url.h"
 
index 115c94e615f7ec7579bb3d176bfb80c40f166db4..c3c679bb0eee78e0795c92a00c7c1bbc6a713229 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "url.h"
 #include "strcase.h"
index 10fc9797248cd778cd325ae385bf838ecbef8f1c..fc84b3365768f2c54c46d14d74304de04ec04871 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "vtls/x509asn1.h"
 
 static CURLcode test_unit1651(const char *arg)
index 56354641a2bdc8f6a8f3197644b7afd511f587bc..13c1b0175ae970b3e2d2f0a196e99b5506863fc8 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "curl_trc.h"
 
index b2987e8693385c915052bfc7d0820293e3842c8e..ef42153ba1d89484e403d2b9c31846839060b0a5 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "altsvc.h"
 
index e1cf6e1ec6b48c0cfef34d35a0479b9913e3ed1f..7fc1a2dca6a2105649702db9f56f8c5a8c498941 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
-
 #include "vtls/x509asn1.h"
 
 struct test_spec {
index e728da94e216d0cbf442cdaf8caba6c66aa27667..1a33ec1b923252e1cfe2699a0f9e4e058ea1df68 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_MBEDTLS)
-
 #include "vtls/x509asn1.h"
 
 struct test1657_spec {
index f2536e6e62e86de1e7b8699d9fa193c813919f10..fa281fe3eace95bb654bb98b52a76813734637d6 100644 (file)
@@ -25,7 +25,6 @@
 
 /* DoH + HTTPSRR are required */
 #if !defined(CURL_DISABLE_DOH) && defined(USE_HTTPSRR)
-
 #include "doh.h"
 #include "httpsrr.h"
 
index a0698b31cd39e5724848f90fc34ee610bdbe8ff3..b42a0bae7a07223a72f0b42bde6dafc02bd5d586 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_HSTS)
-
 #include "urldata.h"
 #include "hsts.h"
 
index 1a211db28e8a286fb010cf95d1219f29a37b5458..01ea112ce6d27b9504b7bc57544be9ea4fe6ed14 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "bufq.h"
 #include "curl_trc.h"
index 4c757bd4b79fe6b2e34415a66c514c9375b5e83d..7c9b480eae377e577bfb63ae84d037875b381bc7 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "dynhds.h"
 #include "curl_trc.h"
index 730b604dc36417b0cc12c0bd5841c8363f857401..15ec12c41d211c433ad3ebe5258e42f66c246cf3 100644 (file)
@@ -24,7 +24,6 @@
 #include "unitcheck.h"
 
 #ifndef CURL_DISABLE_HTTP
-
 #include "urldata.h"
 #include "http1.h"
 #include "curl_trc.h"
index cc8ca3cd6c2bab836ade2027c8bf573b12aa36f9..e7de755331d2cdaef4749bf656519a9993b9f093 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "vtls/cipher_suite.h"
 
 static CURLcode test_unit3205(const char *arg)
index a8b7fbd660fd682c70e4e8c41f30d3f27d2fafda..6ed9cbfe1b3fe6a5989ebbbcf25c3a5b32b0b8ad 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "uint-table.h"
 #include "curl_trc.h"
index f288d4a3f501998bf2e3f67c58b2a3fb7d5db72b..f2ecae4d1345ac7c67416dd6ae3bb70131ed2a8c 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 #include "uint-spbset.h"
 #include "curl_trc.h"
index 6b10352953cd337135589f2ea40f1489e397231d..8f22f53cc64d46be07e9f55dcee43102fb4259bf 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "urldata.h"
 
 static void checksize(const char *name, size_t size, size_t allowed)
index 4c7b27622937ff889770575b78a7a2bf171eae41..6bf922545f9b7a2441a345d1b5f0750de7cdd53b 100644 (file)
@@ -22,7 +22,6 @@
  *
  ***************************************************************************/
 #include "unitcheck.h"
-
 #include "ratelimit.h"
 
 static CURLcode test_unit3216(const char *arg)